diff --git a/src/utils/seo.ts b/src/utils/seo.ts index 12b62e920..ff79070e0 100644 --- a/src/utils/seo.ts +++ b/src/utils/seo.ts @@ -85,17 +85,17 @@ export async function fetchCompanyInfo(): Promise { export async function generateMetadataFromSeo( seo: SeoData | null, ): Promise { - const { data: fallbackSeo } = await loadQuery( + const { data: defaultSeo } = await loadQuery( DEFAULT_SEO_QUERY, ); const companyInfo = await fetchCompanyInfo(); const title = seo?.title || - fallbackSeo?.seo?.seoTitle || + defaultSeo?.seo?.seoTitle || companyInfo?.siteMetadata?.siteName || "Variant"; - const description = seo?.description || fallbackSeo?.seo?.seoDescription; + const description = seo?.description || defaultSeo?.seo?.seoDescription; const keywords = seo?.keywords || ""; const favicon = companyInfo?.brandAssets?.favicon; @@ -109,7 +109,7 @@ export async function generateMetadataFromSeo( title: title, ...(description ? { description: description } : {}), })}`; - const sanityImageUrl = seo?.imageUrl || fallbackSeo?.seo?.seoImageUrl; + const sanityImageUrl = seo?.imageUrl || defaultSeo?.seo?.seoImageUrl; const sanityImageParams = `?${new URLSearchParams({ w: OPEN_GRAPH_IMAGE_DIMENSIONS.width.toString(), h: OPEN_GRAPH_IMAGE_DIMENSIONS.height.toString(),