* docs: add VidBee Docs suffix to all documentation page titles Update the page title metadata generation to append "| VidBee Docs" to all documentation page titles for consistent branding across the site. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * docs: add canonical URLs to documentation pages Add canonical URL metadata to all documentation pages to prevent search engine duplication issues and improve SEO rankings. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * feat(docs): add automatic sitemap * fix(docs): align canonical base URL * fix(docs): configure sitemap for static export Add 'export const dynamic = "force-static"' to sitemap.ts to enable static generation when using Next.js output: export mode. This fixes the build error: "export const dynamic = 'force-static'/export const revalidate not configured on route '/sitemap.xml'". Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * chore(docs): add favicon and icon assets Add favicons and app icons in various sizes for better browser and platform support. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
35 lines
766 B
TypeScript
35 lines
766 B
TypeScript
import type { MetadataRoute } from 'next';
|
|
import { i18n } from '@/lib/i18n';
|
|
import { source } from '@/lib/source';
|
|
|
|
export const dynamic = 'force-static';
|
|
|
|
const baseUrl = 'https://docs.vidbee.org';
|
|
|
|
function buildPath(segments: string[]): string {
|
|
if (segments.length === 0) {
|
|
return '/';
|
|
}
|
|
return `/${segments.join('/')}/`;
|
|
}
|
|
|
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
const params = source.generateParams();
|
|
|
|
return params.map(({ lang, slug }) => {
|
|
const segments: string[] = [];
|
|
|
|
if (lang && lang !== i18n.defaultLanguage) {
|
|
segments.push(lang);
|
|
}
|
|
|
|
if (slug && slug.length > 0) {
|
|
segments.push(...slug);
|
|
}
|
|
|
|
return {
|
|
url: `${baseUrl}${buildPath(segments)}`,
|
|
};
|
|
});
|
|
}
|