Update documentation loader limit and optimize sitemap generation

The documentation loader has been updated to limit the number of items to 500 from the previous limit of 'Number.MAX_SAFE_INTEGER'. Additionally, the handling of URL generation and item retrieval in 'server-sitemap.xml/route.ts' has been refactored for more effective sitemap generation. A new 'robots.ts' file was created to set up default rules for web robots accessing the site.
This commit is contained in:
gbuomprisco
2024-06-20 19:28:47 +08:00
parent b9acbffcae
commit b288bca6b8
4 changed files with 25 additions and 12 deletions

View File

@@ -54,7 +54,7 @@ function Node({
activePath: string;
}) {
const pathPrefix = `/docs`;
const url = `${pathPrefix}/${node.url}`;
const url = `${pathPrefix}/${node.slug}`;
return (
<>

View File

@@ -15,7 +15,7 @@ async function docsLoader(language: string | undefined) {
const { items: pages } = await cms.getContentItems({
collection: 'documentation',
language,
limit: Number.MAX_SAFE_INTEGER,
limit: 500
});
return pages;