Add best practices to sitemap

pull/3356/head
Kamran Ahmed 2 years ago
parent 3df8db5fa5
commit f06dfce7fb
  1. 6
      sitemap.mjs

@ -5,6 +5,10 @@ async function getRoadmapIds() {
return fs.readdir(path.join(process.cwd(), 'src/roadmaps')); return fs.readdir(path.join(process.cwd(), 'src/roadmaps'));
} }
async function getBestPracticesIds() {
return fs.readdir(path.join(process.cwd(), 'src/best-practices'));
}
export function shouldIndexPage(page) { export function shouldIndexPage(page) {
return ![ return ![
'https://roadmap.sh/404', 'https://roadmap.sh/404',
@ -19,9 +23,11 @@ export async function serializeSitemap(item) {
'https://roadmap.sh', 'https://roadmap.sh',
'https://roadmap.sh/about', 'https://roadmap.sh/about',
'https://roadmap.sh/roadmaps', 'https://roadmap.sh/roadmaps',
'https://roadmap.sh/best-practices',
'https://roadmap.sh/guides', 'https://roadmap.sh/guides',
'https://roadmap.sh/videos', 'https://roadmap.sh/videos',
...(await getRoadmapIds()).flatMap((id) => [`https://roadmap.sh/${id}`, `https://roadmap.sh/${id}/topics`]), ...(await getRoadmapIds()).flatMap((id) => [`https://roadmap.sh/${id}`, `https://roadmap.sh/${id}/topics`]),
...(await getBestPracticesIds()).map((id) => `https://roadmap.sh/best-practices/${id}`),
]; ];
// Roadmaps and other high priority pages // Roadmaps and other high priority pages

Loading…
Cancel
Save