From b112e06dc54bd6f5df2404db2482db39f3f3fc9c Mon Sep 17 00:00:00 2001 From: Mathias Oterhals Myklebust Date: Fri, 20 Sep 2024 14:50:47 +0200 Subject: [PATCH 1/2] feat(customerCasesPage): seo fields --- studio/schemas/documents/specialPages/customerCasesPage.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/studio/schemas/documents/specialPages/customerCasesPage.ts b/studio/schemas/documents/specialPages/customerCasesPage.ts index 61f3a2b9b..8d17f527d 100644 --- a/studio/schemas/documents/specialPages/customerCasesPage.ts +++ b/studio/schemas/documents/specialPages/customerCasesPage.ts @@ -1,6 +1,7 @@ import { defineType } from "sanity"; import { title } from "studio/schemas/fields/text"; +import seo from "studio/schemas/objects/seo"; import { titleSlug } from "studio/schemas/schemaTypes/slug"; export const customerCasesPageID = "customerCasesPage"; @@ -17,6 +18,7 @@ const customerCasesPage = defineType({ "Enter the primary title that will be displayed at the top of the customer cases page. This is what users will see when they visit the page.", }, titleSlug, + seo, ], preview: { select: { From 42b6637248921bde48f918a414d47c995da8281e Mon Sep 17 00:00:00 2001 From: Mathias Oterhals Myklebust Date: Fri, 20 Sep 2024 14:51:14 +0200 Subject: [PATCH 2/2] feat(seo): include non-pageBuilder documents in seo fetching --- studio/lib/queries/page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/studio/lib/queries/page.ts b/studio/lib/queries/page.ts index d25aa3e05..75a300223 100644 --- a/studio/lib/queries/page.ts +++ b/studio/lib/queries/page.ts @@ -77,7 +77,7 @@ export const SLUG_QUERY = groq` `; export const SEO_SLUG_QUERY = groq` - *[_type == "pageBuilder" && slug.current == $slug][0]{ + *[defined(seo) && slug.current == $slug][0]{ "title": seo.seoTitle, "description": seo.seoDescription, "imageUrl": seo.seoImage.asset->url