Skip to content

Commit

Permalink
fix!: astro has the new config option output: 'static' | 'server'
Browse files Browse the repository at this point in the history
  • Loading branch information
alextim committed Jul 27, 2022
1 parent 13433ce commit 0c5a0db
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/astro-sitemap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,14 @@ const createSitemapIntegration = (options: SitemapOptions = {}): AstroIntegratio
}

if (pageUrls.length === 0) {
if (typeof config.adapter !== 'undefined') {
if (config.output !== 'static') {
// offer suggestion for SSR users
logger.warn(`No pages found!
We can only detect sitemap routes for "static" projects. Since you are using an SSR adapter, we recommend manually listing your sitemap routes using the "customPages" integration option.
Example: \`sitemap({ customPages: ['https://example.com/route'] })\``);
logger.warn(
'No pages found!',
'We can only detect sitemap routes for "static" projects. Since you are using an SSR adapter, we recommend manually listing your sitemap routes using the "customPages" integration option.',
'',
"Example: `sitemap({ customPages: ['https://example.com/route'] })`",
);
} else {
logger.warn('No pages found!');
}
Expand Down

0 comments on commit 0c5a0db

Please sign in to comment.