diff --git a/studio/schema.ts b/studio/schema.ts index fd2d3ad9d..83e3136e7 100644 --- a/studio/schema.ts +++ b/studio/schema.ts @@ -15,6 +15,7 @@ import companyLocation from "./schemas/documents/companyLocation"; import compensations from "./schemas/documents/compensations"; import redirect from "./schemas/documents/redirect"; import benefitsByLocation from "./schemas/objects/compensations/benefitsByLocation"; +import seoFallback from "./schemas/documents/admin/fallbackSeo"; export const schema: { types: SchemaTypeDefinition[] } = { types: [ @@ -34,5 +35,6 @@ export const schema: { types: SchemaTypeDefinition[] } = { redirect, benefitsByLocation, companyLocation, + seoFallback, ], }; diff --git a/studio/schemas/deskStructure.ts b/studio/schemas/deskStructure.ts index 1881fc885..5acb0b0f9 100644 --- a/studio/schemas/deskStructure.ts +++ b/studio/schemas/deskStructure.ts @@ -12,6 +12,7 @@ import { CaseIcon, DoubleChevronRightIcon, PinIcon, + SearchIcon, } from "@sanity/icons"; import { soMeLinksID } from "./documents/socialMediaProfiles"; import { companyInfoID } from "./documents/companyInfo"; @@ -19,6 +20,7 @@ import { legalDocumentID } from "./documents/legalDocuments"; import { compensationsId } from "./documents/compensations"; import { redirectId } from "./documents/redirect"; import { companyLocationID } from "./documents/companyLocation"; +import { seoFallbackID } from "./documents/admin/fallbackSeo"; // Admin Section const adminSection = (S: StructureBuilder) => @@ -77,6 +79,23 @@ const siteSettingSection = (S: StructureBuilder) => .child( S.document().schemaType(soMeLinksID).documentId(soMeLinksID), ), + S.listItem() + .title("SEO Configurations") + .icon(SearchIcon) + .child( + S.list() + .title("SEO Configurations") + .items([ + S.listItem() + .title("Fallback SEO") + .child( + S.document() + .schemaType(seoFallbackID) + .documentId(seoFallbackID) + .title("Fallback SEO"), + ), + ]), + ), S.listItem() .title("Broken Links") .icon(DoubleChevronRightIcon) diff --git a/studio/schemas/documents/admin/fallbackSeo.ts b/studio/schemas/documents/admin/fallbackSeo.ts new file mode 100644 index 000000000..6508d876d --- /dev/null +++ b/studio/schemas/documents/admin/fallbackSeo.ts @@ -0,0 +1,32 @@ +import { defineField, defineType } from "sanity"; +import seo from "studio/schemas/objects/seo"; + +export const seoFallbackID = "seoFallback"; + +const seoFallback = defineType({ + name: seoFallbackID, + type: "document", + title: "SEO Configurations", + description: + "Configure global settings for your site including brand assets, tracking codes, and default SEO settings.", + fields: [ + defineField({ + ...seo, + title: "Default SEO Settings", + description: + "If page-specific SEO settings are not provided, these settings will be applied as default.", + options: { + collapsible: false, + }, + }), + ], + preview: { + prepare() { + return { + title: "SEO Configurations", + }; + }, + }, +}); + +export default seoFallback; diff --git a/studio/schemas/objects/seo.ts b/studio/schemas/objects/seo.ts index 010bd39e3..2bf1ecbee 100644 --- a/studio/schemas/objects/seo.ts +++ b/studio/schemas/objects/seo.ts @@ -1,4 +1,4 @@ -import { defineField, StringInputProps } from "sanity"; +import { defineField } from "sanity"; import { StringInputWithCharacterCount } from "studio/components/stringInputWithCharacterCount/StringInputWithCharacterCount"; const seoFieldID = {