2026-04-11 23:38:12 -07:00
|
|
|
import { loader } from "fumadocs-core/source";
|
|
|
|
|
import type { Metadata } from "next";
|
|
|
|
|
import { blog } from "@/.source/server";
|
|
|
|
|
import { BlogWithSearchMagazine } from "./blog-magazine";
|
|
|
|
|
|
|
|
|
|
export const metadata: Metadata = {
|
|
|
|
|
title: "Blog | SurfSense - AI Search & Knowledge Management",
|
2026-04-14 21:26:00 -07:00
|
|
|
description: "Product updates, tutorials, and tips from the SurfSense team.",
|
2026-04-11 23:38:12 -07:00
|
|
|
alternates: {
|
|
|
|
|
canonical: "https://surfsense.com/blog",
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const source = loader({
|
|
|
|
|
baseUrl: "/blog",
|
|
|
|
|
source: blog.toFumadocsSource(),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export interface BlogEntry {
|
|
|
|
|
title: string;
|
|
|
|
|
description: string;
|
|
|
|
|
date: string;
|
|
|
|
|
slug: string;
|
|
|
|
|
url: string;
|
|
|
|
|
image: string;
|
|
|
|
|
author: string;
|
|
|
|
|
authorAvatar: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default async function BlogPage() {
|
|
|
|
|
const allPages = source.getPages() as Array<{
|
|
|
|
|
url: string;
|
|
|
|
|
slugs: string[];
|
|
|
|
|
data: {
|
|
|
|
|
title: string;
|
|
|
|
|
description: string;
|
|
|
|
|
date: string;
|
|
|
|
|
image?: string;
|
|
|
|
|
author?: string;
|
|
|
|
|
authorAvatar?: string;
|
|
|
|
|
};
|
|
|
|
|
}>;
|
|
|
|
|
|
|
|
|
|
const blogs: BlogEntry[] = allPages
|
|
|
|
|
.map((page) => ({
|
|
|
|
|
title: page.data.title,
|
|
|
|
|
description: page.data.description ?? "",
|
|
|
|
|
date: page.data.date,
|
|
|
|
|
slug: page.slugs.join("/"),
|
|
|
|
|
url: page.url,
|
|
|
|
|
image: page.data.image ?? "/og-image.png",
|
|
|
|
|
author: page.data.author ?? "SurfSense Team",
|
|
|
|
|
authorAvatar: page.data.authorAvatar ?? "/logo.png",
|
|
|
|
|
}))
|
2026-04-14 21:26:00 -07:00
|
|
|
.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
|
2026-04-11 23:38:12 -07:00
|
|
|
|
|
|
|
|
return <BlogWithSearchMagazine blogs={blogs} />;
|
|
|
|
|
}
|