From f06dfce7fb15e8a19bef5a79fefee12def75b391 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Wed, 25 Jan 2023 02:53:34 +0400 Subject: [PATCH] Add best practices to sitemap --- sitemap.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sitemap.mjs b/sitemap.mjs index c2c4bfa72..a430fb3da 100644 --- a/sitemap.mjs +++ b/sitemap.mjs @@ -5,6 +5,10 @@ async function getRoadmapIds() { 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) { return ![ 'https://roadmap.sh/404', @@ -19,9 +23,11 @@ export async function serializeSitemap(item) { 'https://roadmap.sh', 'https://roadmap.sh/about', 'https://roadmap.sh/roadmaps', + 'https://roadmap.sh/best-practices', 'https://roadmap.sh/guides', 'https://roadmap.sh/videos', ...(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