Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,68 @@ const config = (async (): Promise<Config> => {
beforeDefaultRehypePlugins: [rehypeShikiPlugin],
rehypePlugins: [rehypeNameToId],
},
sitemap: {
changefreq: 'weekly',
priority: 0.5,
filename: 'sitemap.xml',
createSitemapItems: async (params) => {
const { defaultCreateSitemapItems, ...rest } = params;
const items = await defaultCreateSitemapItems(rest);
return items.map((item) => {
// Use pathname so priorities work on deploy previews too
const path = new URL(item.url).pathname;

// Homepage — highest priority
if (path === '/') {
return { ...item, priority: 1.0, changefreq: 'daily' };
}

// v2 docs (current, no version prefix) — high priority
if (path.startsWith('/docs/') && !path.startsWith('/docs/v1/') && !path.startsWith('/docs/0.82/')) {
if (
path === '/docs/' ||
path.startsWith('/docs/quickstart/') ||
path.startsWith('/docs/overview/')
) {
return { ...item, priority: 0.9, changefreq: 'weekly' };
}
return { ...item, priority: 0.8, changefreq: 'weekly' };
}

// Blog posts — high priority
if (path.startsWith('/blog/') || path === '/blog/') {
if (path === '/blog/' || path === '/blog') {
return { ...item, priority: 0.8, changefreq: 'daily' };
}
if (path.startsWith('/blog/page/') || path.startsWith('/blog/tags/')) {
return { ...item, priority: 0.3, changefreq: 'weekly' };
}
return { ...item, priority: 0.7, changefreq: 'monthly' };
}

// Community meeting notes
if (path.startsWith('/community/') || path === '/community/') {
if (path === '/community/' || path === '/community') {
return { ...item, priority: 0.7, changefreq: 'weekly' };
}
return { ...item, priority: 0.5, changefreq: 'weekly' };
}

// v1 docs — deprioritized
if (path.startsWith('/docs/v1/')) {
return { ...item, priority: 0.3, changefreq: 'monthly' };
}

// 0.82 docs — already disallowed in robots.txt, minimal priority
if (path.startsWith('/docs/0.82/')) {
return { ...item, priority: 0.1, changefreq: 'yearly' };
}

// Everything else (standalone pages like /contact, etc.)
return { ...item, priority: 0.5, changefreq: 'monthly' };
});
},
},
theme: {
customCss: [require.resolve('./src/styles/index.css')],
},
Expand Down
Loading