mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
aa93cc5e69
* Migrate docs to package-backed geistdocs * update agent install cmd on home page * add copy prompt component usage * update docs test for sitemap inclusion * cut unused components * address docs migration review feedback * address stale review feedback: geistdocs 1.8.2, version icons, cookbook prompts * drop Workflow from OSS products dropdown (self-link) * bump @vercel/geistdocs to 1.11.0 * fix: resolve pnpm-lock.yaml conflict marker from main merge --------- Co-authored-by: Peter Wielander <peter.wielander@vercel.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
39 lines
1011 B
TypeScript
39 lines
1011 B
TypeScript
import type { MetadataRoute } from 'next';
|
|
|
|
import { currentSources } from '@/lib/geistdocs/source';
|
|
|
|
const protocol = process.env.NODE_ENV === 'production' ? 'https' : 'http';
|
|
const host =
|
|
process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL ?? 'localhost:3000';
|
|
const baseUrl = `${protocol}://${host}`;
|
|
|
|
export const revalidate = false;
|
|
|
|
export default function sitemap(): MetadataRoute.Sitemap {
|
|
const url = (path: string): string => new URL(path, baseUrl).toString();
|
|
|
|
const pages: MetadataRoute.Sitemap = [];
|
|
|
|
for (const source of currentSources) {
|
|
for (const page of source.source.getPages()) {
|
|
// Exclude internal/preview-only pages from sitemap
|
|
if (page.url.includes('/internal')) continue;
|
|
pages.push({
|
|
changeFrequency: 'weekly' as const,
|
|
lastModified: undefined,
|
|
priority: 0.5,
|
|
url: url(page.url),
|
|
});
|
|
}
|
|
}
|
|
|
|
return [
|
|
{
|
|
changeFrequency: 'monthly',
|
|
priority: 1,
|
|
url: url('/'),
|
|
},
|
|
...pages,
|
|
];
|
|
}
|