Skip to content

Instantly share code, notes, and snippets.

@MaikelVeen
Last active January 9, 2021 22:06
Show Gist options
  • Save MaikelVeen/6bfdadea2c351ee29b10379ab5f142bd to your computer and use it in GitHub Desktop.
Save MaikelVeen/6bfdadea2c351ee29b10379ab5f142bd to your computer and use it in GitHub Desktop.
Getting the paths from the manifest object
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