SurfSense/surfsense_web/app/docs/[[...slug]]/page.tsx
DESKTOP-RTLN3BA\$punk 219a5977b7 fix: update URLs to use the "www" subdomain across the application
This commit modifies various metadata and canonical URLs in the SurfSense application to ensure consistency by using "https://www.surfsense.com" instead of "https://surfsense.com". Changes were made in layout files, blog posts, and SEO components to reflect this update.
2026-05-15 12:35:15 -07:00

61 lines
1.6 KiB
TypeScript

import { DocsBody, DocsDescription, DocsPage, DocsTitle } from "fumadocs-ui/page";
import { notFound } from "next/navigation";
import { cache } from "react";
import { source } from "@/lib/source";
import { getMDXComponents } from "@/mdx-components";
const getDocPage = cache((slug?: string[]) => {
return source.getPage(slug);
});
export default async function Page(props: { params: Promise<{ slug?: string[] }> }) {
const params = await props.params;
const page = getDocPage(params.slug);
if (!page) notFound();
const MDX = page.data.body;
return (
<DocsPage
toc={page.data.toc}
full={page.data.full}
tableOfContent={{
style: "clerk",
single: false,
}}
tableOfContentPopover={{
style: "clerk",
}}
>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX components={getMDXComponents()} />
</DocsBody>
</DocsPage>
);
}
export async function generateStaticParams() {
return source.generateParams();
}
export async function generateMetadata(props: { params: Promise<{ slug?: string[] }> }) {
const params = await props.params;
const page = getDocPage(params.slug);
if (!page) notFound();
const slugPath = params.slug ? params.slug.join("/") : "";
return {
title: `${page.data.title} | SurfSense Docs`,
description: page.data.description,
alternates: {
canonical: `https://www.surfsense.com/docs${slugPath ? `/${slugPath}` : ""}`,
},
openGraph: {
title: `${page.data.title} | SurfSense Docs`,
description: page.data.description,
type: "article",
},
};
}