Skip to content

Commit

Permalink
fix: prerender sitemap when using github_pages
Browse files Browse the repository at this point in the history
Relates to #256
  • Loading branch information
harlan-zw committed Jul 1, 2024
1 parent c6fa023 commit c429fb4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { defu } from 'defu'
import { extractSitemapMetaFromHtml } from './util/extractSitemapMetaFromHtml'
import type { ModuleRuntimeConfig, SitemapUrl } from './runtime/types'
import { splitForLocales } from './runtime/utils-pure'
import { resolveNitroPreset } from './util/kit'

function formatPrerenderRoute(route: PrerenderRoute) {
let str = ` ├─ ${route.route} (${route.generateTimeMS}ms)`
Expand All @@ -36,7 +37,10 @@ export function includesSitemapRoot(sitemapName: string, routes: string[]) {
}

export function isNuxtGenerate(nuxt: Nuxt = useNuxt()) {
return nuxt.options._generate || nuxt.options.nitro.static || nuxt.options.nitro.preset === 'static'
return nuxt.options._generate || [
'static',
'github-pages',
].includes(resolveNitroPreset())
}

export function setupPrerenderHandler(options: ModuleRuntimeConfig, nuxt: Nuxt = useNuxt()) {
Expand Down

0 comments on commit c429fb4

Please sign in to comment.