Last active
January 9, 2021 22:06
-
-
Save MaikelVeen/6bfdadea2c351ee29b10379ab5f142bd to your computer and use it in GitHub Desktop.
Getting the paths from the manifest object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const GetPathsFromManifest = (manifest: any, basePath: string, host: string): Array<Url> => { | |
let routes: Array<string> = []; | |
for (let [route, file] of Object.entries(manifest)) { | |
if (!isNextInternalUrl(route)) { | |
// Add static paths | |
routes = routes.concat(route); | |
} | |
} | |
let sitemapUrls: Array<Url> = []; | |
routes.forEach((route) => { | |
sitemapUrls.push({ host: host, route: route }); | |
}); | |
return sitemapUrls; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment