Skip to content

Commit 116848f

Browse files
authored
hotfix: only one og (#7291)
1 parent b2046cf commit 116848f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

apps/site/next.dynamic.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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';
1617
import {
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

0 commit comments

Comments
 (0)