Generate sitemap endpoints from json

This commit is contained in:
Sam Carlton 2021-02-23 22:41:27 -06:00
parent 11aa303b2e
commit 522a1651c3
2 changed files with 32 additions and 11 deletions

View file

@ -127,7 +127,18 @@ export default {
],
sitemap: {
hostname: 'https://doesitarm.com'
hostname: 'https://doesitarm.com',
routes: async () => {
// Get routes from previous build
const sitemapEndpoints = await fs.readFile('./static/sitemap-endpoints.json', 'utf-8')
.then( endpointsJson => {
return JSON.parse(endpointsJson)
})
console.log('Total Sitemap Endpoints', sitemapEndpoints.length)
return sitemapEndpoints.map( endpoint => endpoint.route )
}
},
buildModules: [