mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Include sitemap and endpoint lists for api
This commit is contained in:
parent
cd953abd45
commit
a9d467bec7
1 changed files with 13 additions and 14 deletions
|
|
@ -533,23 +533,22 @@ class BuildLists {
|
||||||
// ['/app/chrome', this.endpointMaps.eleventy.get( '/app/chrome' )]
|
// ['/app/chrome', this.endpointMaps.eleventy.get( '/app/chrome' )]
|
||||||
// ])
|
// ])
|
||||||
|
|
||||||
if ( !cliOptions.withApi ) {
|
|
||||||
for ( const [ endpointSetName, endpointSet ] of Object.entries(this.endpointMaps) ) {
|
|
||||||
// Save Endpoints
|
|
||||||
await this.saveToJson(Array.from( endpointSet , ([route, payload]) => ({ route, payload })), `./static/${endpointSetName}-endpoints.json`)
|
|
||||||
}
|
|
||||||
|
|
||||||
const sitemapEndpoints = Object.values(this.endpointMaps).map( endpointSet => {
|
for ( const [ endpointSetName, endpointSet ] of Object.entries(this.endpointMaps) ) {
|
||||||
return Array.from( endpointSet , ([route, payload]) => ({ route, payload }) )
|
// Save Endpoints
|
||||||
} ).flat(1)
|
await this.saveToJson(Array.from( endpointSet , ([route, payload]) => ({ route, payload })), `./static/${endpointSetName}-endpoints.json`)
|
||||||
|
|
||||||
// Save sitemap endpoints
|
|
||||||
await this.saveToJson( sitemapEndpoints, './static/sitemap-endpoints.json')
|
|
||||||
|
|
||||||
// Save stork toml index
|
|
||||||
await writeStorkToml( sitemapEndpoints )
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sitemapEndpoints = Object.values(this.endpointMaps).map( endpointSet => {
|
||||||
|
return Array.from( endpointSet , ([route, payload]) => ({ route, payload }) )
|
||||||
|
} ).flat(1)
|
||||||
|
|
||||||
|
// Save sitemap endpoints
|
||||||
|
await this.saveToJson( sitemapEndpoints, './static/sitemap-endpoints.json')
|
||||||
|
|
||||||
|
// Save stork toml index
|
||||||
|
await writeStorkToml( sitemapEndpoints )
|
||||||
|
|
||||||
console.log('Total Nuxt Endpoints', this.endpointMaps.nuxt.size )
|
console.log('Total Nuxt Endpoints', this.endpointMaps.nuxt.size )
|
||||||
console.log('Total Eleventy Endpoints', this.endpointMaps.eleventy.size )
|
console.log('Total Eleventy Endpoints', this.endpointMaps.eleventy.size )
|
||||||
console.log('Total Endpoints', this.endpointMaps.nuxt.size + this.endpointMaps.eleventy.size )
|
console.log('Total Endpoints', this.endpointMaps.nuxt.size + this.endpointMaps.eleventy.size )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue