Only display notice if needed (#659)

This commit is contained in:
Johan Stenehall 2021-07-12 15:25:14 +02:00 committed by GitHub
parent c48acb3d84
commit 1b73f95806
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Only show the buildOptions.site notice if not already set

View file

@ -53,7 +53,9 @@ export async function build(astroConfig: AstroConfig, logging: LogOptions = defa
};
// warn users if missing config item in build that may result in broken SEO (cant disable, as they should provide this)
warn(logging, 'config', `Set "buildOptions.site" to generate correct canonical URLs and sitemap`);
if (!astroConfig.buildOptions.site) {
warn(logging, 'config', `Set "buildOptions.site" to generate correct canonical URLs and sitemap`);
}
const mode: RuntimeMode = 'production';
const runtime = await createRuntime(astroConfig, { mode, logging: runtimeLogging });