From a1145f498eb608d6bde5f68275fc61d358e49d61 Mon Sep 17 00:00:00 2001 From: Stefan Probst Date: Tue, 17 Oct 2023 12:33:26 +0200 Subject: [PATCH] fix: allow editing landing page title and content via cms --- src/cms/collections/pages.collection.ts | 27 ++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/cms/collections/pages.collection.ts b/src/cms/collections/pages.collection.ts index 5fb4dcf47..9dc0d0312 100644 --- a/src/cms/collections/pages.collection.ts +++ b/src/cms/collections/pages.collection.ts @@ -10,10 +10,14 @@ export const collection: CmsCollection = { description: "", format: "frontmatter", files: [ + /** + * NetlifyCMS currently only supports "single_file" i18n mode for file collections, + * which we don't want, so we expose two separate file entries. + */ { - file: "content/pages/home.mdx", - name: "home", - label: "Home page", + file: "content/pages/de/home.mdx", + name: "home-de", + label: "Home page (german)", fields: [ { name: "title", @@ -21,8 +25,21 @@ export const collection: CmsCollection = { hint: "", }, { - name: "subtitle", - label: "Subtitle", + name: "body", + label: "Content", + hint: "", + widget: "markdown", + }, + ], + }, + { + file: "content/pages/en/home.mdx", + name: "home-en", + label: "Home page (english)", + fields: [ + { + name: "title", + label: "Title", hint: "", }, {