Save sitemap as xml during build

This commit is contained in:
Sam Carlton 2022-06-06 20:41:37 -05:00
parent fc8dd41f18
commit 915c1b0a3a
3 changed files with 34 additions and 3 deletions

View file

@ -13,6 +13,7 @@ import buildGamesList from '~/helpers/build-game-list.js'
import buildHomebrewList from '~/helpers/build-homebrew-list.js'
import buildVideoList from '~/helpers/build-video-list.js'
import buildDeviceList from '~/helpers/build-device-list.js'
import { saveSitemap } from '~/helpers/api/sitemap/build.js'
import { deviceSupportsApp } from '~/helpers/devices.js'
import getListSummaryNumbers from '~/helpers/get-list-summary-numbers.js'
@ -697,13 +698,14 @@ class BuildLists {
})
} )
// Add paginated category lists to sitemap
// sitemapEndpoints.push( ...this.getKindListForCategories() )
// Save sitemap endpoints
console.log('Building Sitemap JSON')
await this.saveToJson( sitemapEndpoints, './static/sitemap-endpoints.json')
// Save XML Sitemap
console.log('Building XML Sitemap')
await saveSitemap( sitemapEndpoints.map( ({ route }) => route ) )
// Save stork toml index
console.log('Building Stork toml index')
await writeStorkToml( sitemapEndpoints )