From 392640e1152fd7ea93e4385bc70527903108f354 Mon Sep 17 00:00:00 2001 From: Mikael Brevik Date: Wed, 11 Dec 2024 20:44:10 +0100 Subject: [PATCH] fix: seo and fallback seo/opengraph settings --- src/utils/seo.ts | 10 +++++----- studio/lib/queries/pages.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils/seo.ts b/src/utils/seo.ts index 9435cd48d..be49c24b9 100644 --- a/src/utils/seo.ts +++ b/src/utils/seo.ts @@ -43,12 +43,12 @@ export async function generateMetadataFromSeo( ); const title = - seo?.title || - defaultSeo?.seo?.title || - companyInfo?.companyName || + seo?.title ?? + defaultSeo?.seo?.title ?? + companyInfo?.companyName ?? "Variant"; - const description = seo?.description || defaultSeo?.seo?.description; - const keywords = seo?.keywords || ""; + const description = seo?.description ?? defaultSeo?.seo?.description; + const keywords = seo?.keywords ?? ""; const favicon = brandAssets?.favicon; const faviconUrl = favicon ? urlFor(favicon).url() : ""; diff --git a/studio/lib/queries/pages.ts b/studio/lib/queries/pages.ts index 69766a785..136d1dc05 100644 --- a/studio/lib/queries/pages.ts +++ b/studio/lib/queries/pages.ts @@ -90,7 +90,7 @@ const SECTIONS_FRAGMENT = groq` `; export const SEO_FRAGMENT = groq` - "seo": ${translatedFieldFragment("seo")} { + "seo": seo{ "title": seoTitle, "description": seoDescription, "imageUrl": seoImage.asset->url,