1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-04-18 22:36:00 +02:00

Add best practices to sitemap

This commit is contained in:
Kamran Ahmed 2023-01-25 02:53:34 +04:00
parent 3df8db5fa5
commit f06dfce7fb

View File

@ -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