File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212 BASE_PATH ,
1313 IS_DEVELOPMENT ,
1414 DEFAULT_CATEGORY_OG_TYPE ,
15+ ENABLE_STATIC_EXPORT ,
1516} from './next.constants.mjs' ;
1617import {
1718 IGNORED_ROUTES ,
@@ -222,9 +223,9 @@ const getDynamicRouter = async () => {
222223
223224 // Default Open Graph Image for the page
224225 pageMetadata . openGraph . images = [
225- ` ${ defaultLocale . code } /next-data/og/ ${ data . category ?? DEFAULT_CATEGORY_OG_TYPE } / ${ pageMetadata . title } ` ,
226- // Provides the default OG image as the first one will give a 404 on full static exports
227- `${ defaultLocale . code } /next-data/og/announcement/Run JavaScript Everywhere ` ,
226+ ENABLE_STATIC_EXPORT
227+ ? ` ${ defaultLocale . code } /next-data/og/announcement/Run JavaScript Everywhere`
228+ : `${ defaultLocale . code } /next-data/og/${ data . category ?? DEFAULT_CATEGORY_OG_TYPE } / ${ pageMetadata . title } ` ,
228229 ] ;
229230
230231 // Default canonical URL for the page
You can’t perform that action at this time.
0 commit comments