Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(docs): Use accurate non-equivalent timestamps for docs sitemap. (#1241)

Morgan Dean91c56658e563
diff --git a/docs/source.config.ts b/docs/source.config.ts
index 28c92e7175..e7c47abf2e 100644
--- a/docs/source.config.ts
+++ b/docs/source.config.ts
@@ -23,6 +23,7 @@ export const docs = defineDocs({
});
export default defineConfig({
+ lastModifiedTime: 'git',
mdxOptions: {
// MDX options
},
diff --git a/docs/src/app/sitemap.ts b/docs/src/app/sitemap.ts
index 4aa0680fd8..0bfa486aaf 100644
--- a/docs/src/app/sitemap.ts
+++ b/docs/src/app/sitemap.ts
@@ -14,16 +14,24 @@ export default function sitemap(): MetadataRoute.Sitemap {
return {
url: `${baseUrl}${url}`,
- lastModified: new Date(),
+ lastModified: page.data.lastModified
+ ? new Date(page.data.lastModified)
+ : undefined,
changeFrequency: 'weekly' as const,
priority: url === '/docs' ? 1.0 : 0.8,
};
});
- // Add main docs page if not included
+ // Add main docs page with the most recent lastModified across all doc pages
+ const latestModified = docPages.reduce<Date | undefined>((latest, page) => {
+ if (!page.lastModified) return latest;
+ if (!latest) return page.lastModified;
+ return page.lastModified > latest ? page.lastModified : latest;
+ }, undefined);
+
const mainDocsPage = {
url: `${baseUrl}/docs`,
- lastModified: new Date(),
+ lastModified: latestModified,
changeFrequency: 'weekly' as const,
priority: 1.0,
};