decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.99k stars 3.05k forks source link

Preview Template isn't registered correctly #5768

Closed quansenB closed 1 year ago

quansenB commented 3 years ago

Describe the bug I’m currently building a site with netlify cms and gatsby. I’m using gastby-plugin-netlify-cms@5.11.0 and netlify-cms-app@2.15.38.

However when I’m trying to register a preview template it is ignored. I’m developing as close to gatsby-starter-netlify-cms as possible, because it was working there.

This is my cms.js file:

import CMS from 'netlify-cms-app'
import uploadcare from 'netlify-cms-media-library-uploadcare'
import cloudinary from 'netlify-cms-media-library-cloudinary'

import JammerfastenDayPagePreview from "./preview-templates/JammerfastenDayPagePreview";
import OptInPagePreview from "./preview-templates/OptInPagePreview";
import SharingPagePreview from "./preview-templates/SharingPagePreview";
import ThankYouPagePreview from "./preview-templates/ThankYouPagePreview";
import UpsellPagePreview from "./preview-templates/UpsellPagePreview";
import VideoPagePreview from "./preview-templates/VideoPagePreview";

import BlogPostPreview from './preview-templates/BlogPostPreview'

// import { de } from "netlify-cms-locales";

CMS.registerMediaLibrary(uploadcare)
CMS.registerMediaLibrary(cloudinary)

// CMS.registerLocale("de", de);

CMS.registerPreviewTemplate("dayPages", JammerfastenDayPagePreview);
CMS.registerPreviewTemplate("optInPages", OptInPagePreview);
CMS.registerPreviewTemplate("sharingPages", SharingPagePreview);
CMS.registerPreviewTemplate("thankYouPages", ThankYouPagePreview);
CMS.registerPreviewTemplate("upsellPages", UpsellPagePreview);
CMS.registerPreviewTemplate("videoPages", VideoPagePreview);

CMS.registerPreviewTemplate('blog', BlogPostPreview)

This is one of the preview files. (the console.logs are not shown in the console thats why im thinking the preview templates aren’t registered):

import React from "react";
import { ThankYouPageTemplate } from "../../templates/thank-you-page";

const ThankYouPagePreview = ({ entry, getAsset }) => {
  const data = entry.getIn(["data"]).toJS();

  if (data) {
    console.log(data);
    return <ThankYouPageTemplate data={data} />;
  } else {
    console.log("CHECK");
    return <div>Loading...</div>;
  }
};

export default ThankYouPagePreview;

this is the corresponding template file:

import React from "react";
import { graphql } from "gatsby";
import Layout from "../components/Layout.js";
import Section from "../components/Section.js";
import RenderMarkdown from "../components/RenderMarkdown.js";
import Video from "../components/Video.js";
import Steps from "../components/Steps.js";

export const ThankYouPageTemplate = ({ data }) => {
  if (!data.seoObject.slug.startsWith("/")) {
    data.seoObject.slug = "/" + data.seoObject.slug;
  }

  return (
    <Layout
      imageObject={data.headerObject.imageObject}
      seoObject={data.seoObject}
    >
      <Section>
        <div className="space-y-5 sm:space-y-10">

        <RenderMarkdown
          markdownContent={data.heroObject.title}
          className="markdown text-center"
        />
        <RenderMarkdown
          markdownContent={data.heroObject.subtitle}
          className="markdown text-center"
        />
        <Video
          videoObject={data.heroObject.video}
          loading="eager"
        />
        </div>
      </Section>

      <Section className="bg-brand-beige-40">
        <Steps stepsObject={data.stepsObject} />
      </Section>
    </Layout>
  );
};

const ThankYouPage = ({ data }) => {
  return <ThankYouPageTemplate data={data.markdownRemark.frontmatter} />;
};

export default ThankYouPage;

export const pageQuery = graphql`
  query ThankYouPage($id: String!) {
    markdownRemark(id: { eq: $id }) {
      frontmatter {
        title
        seoObject {
          canonical
          index
          slug
          description
          imageObject {
            alt
            image {
              publicURL
              childImageSharp {
                original {
                  height
                  width
                }
              }
            }
          }
        }
        headerObject {
          imageObject {
            alt
            image {
              childImageSharp {
                gatsbyImageData(placeholder: TRACED_SVG)
              }
            }
          }
        }
        heroObject {
          video {
            image {
              publicURL
            }
            format
            cloudflareId
          }
          title
          subtitle
        }
        stepsObject {
          title
          steps {
            imageObject {
              alt
              image {
                childImageSharp {
                  gatsbyImageData
                }
              }
            }
            video {
              image {
                publicURL
              }
              format
              cloudflareId
            }
            description
            linkList {
              linkUrl
              linkText
            }
          }
        }
        qAndAObject {
          title
          qAndA {
            question
            answer
          }
        }
      }
    }
  }
`;

My preview template names are exactly as they are in the config.yml file.

I’m pretty much out of ideas where the error could be so I’d appreciate any input.

Thank you in advance.

To Reproduce You can use the code above plus the config.yml below to reproduce the issue.

Expected behavior The preview template is registered correctly

Applicable Versions:

CMS configuration

backend:
  name: git-gateway
  branch: master
  commit_messages:
    create: "Create {{collection}} “{{slug}}”"
    update: "Update {{collection}} “{{slug}}”"
    delete: "Delete {{collection}} “{{slug}}”"
    uploadMedia: "[skip ci] Upload “{{path}}”"
    deleteMedia: "[skip ci] Delete “{{path}}”"

media_folder: src/img
public_folder: /img

# site_url: https://jammerfasten.de
# show_preview_links: false

locale: "de"

collections:
  - name: "blog"
    label: "Blog"
    folder: "src/pages/blog"
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    fields:
      - {
          label: "Template Key",
          name: "templateKey",
          widget: "hidden",
          default: "blog-post",
        }
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Publish Date", name: "date", widget: "datetime" }
      - { label: "Beschreibung", name: "description", widget: "text" }
      - { label: "Featured Post", name: "featuredpost", widget: "boolean" }
      - { label: "Featured Bild", name: "featuredimage", widget: image }
      - { label: "Body", name: "body", widget: "markdown" }
      - { label: "Tags", name: "tags", widget: "list" }

  - label: Opt In Seiten
    name: optInPages
    folder: "src/pages/optInPages"
    create: true
    slug: "{{slug}}"
    fields:
      - {
          label: "Template Key",
          name: "templateKey",
          widget: "hidden",
          default: "opt-in-page",
        }
      - { label: Interner Titel, name: title, widget: string }
      - {
          label: SEO,
          name: seoObject,
          widget: object,
          fields:
            [
              {
                label: URL-Endung,
                name: slug,
                widget: string,
                pattern:
                  [
                    "^[a-z0-9/]+(?:-[a-z0-9/-]+)*$",
                    'Die URL Endung kann nur aus a-z, 0-9 sowie "/" und "-" bestehen',
                  ],
                hint: "Erlaubte Zeichen: 0-9, a-z, -, /",
              },
              { label: Titel, name: title, widget: string },
              { label: Beschreibung, name: description, widget: text },
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              {
                label: Canonical URL,
                name: canonical,
                widget: string,
                required: false,
                default: "",
              },
              {
                label: Bei Google auffindbar?,
                name: index,
                widget: boolean,
                default: true,
              },
            ],
        }
      - {
          label: Kopfzeile,
          name: headerObject,
          widget: object,
          fields:
            [
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
            ],
        }
      - {
          label: Herosektion,
          name: heroObject,
          widget: object,
          fields:
            [
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    {
                      label: Bild für Handys,
                      name: mobileImage,
                      widget: image,
                      hint: Falls notwendig,
                      required: false,
                    },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              { label: Titel, name: title, widget: markdown },
              { label: Untertitel, name: subtitle, widget: markdown },
              { label: CTA-Titel, name: ctaTitle, widget: markdown },
              { label: CTA-Text, name: cta, widget: markdown },
            ],
        }
      - {
          label: Vorteile,
          name: benefitsObject,
          widget: object,
          fields:
            [
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              { label: Titel, name: title, widget: markdown },
              { label: Text, name: text, widget: markdown },
              {
                label: Vorteile Liste,
                name: benefitsList,
                widget: list,
                fields:
                  [

                    {
                      label: Icon,
                      name: iconName,
                      widget: select,
                      options: [{ label: Herz, value: "heart" }, {label: Doppelpfeil runter, value: "doubleArrowDown" }],
                    },
                    { label: Titel, name: title, widget: markdown },

                  ],
              },
              { label: CTA-Titel, name: ctaTitle, widget: markdown },
              { label: CTA, name: cta, widget: markdown },
            ],
        }
      - {
          label: Statistiken,
          name: statsObject,
          widget: object,
          fields:
            [
              { label: Titel, name: title, widget: markdown },
              {
                label: Statistiken Liste,
                name: statisList,
                widget: list,
                fields:
                  [
                    { label: Zahl, name: number, widget: number },
                    { label: Titel, name: title, widget: markdown },
                    {
                      label: Untertitel,
                      name: subtitle,
                      widget: markdown,
                      required: false,
                      default: "",
                    },
                  ],
              },
            ],
        }
      - {
          label: Vorstellung Peter,
          name: introductionObject,
          widget: object,
          fields:
            [
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              {
                label: Liste Eigenschaften,
                name: list,
                widget: list,
                required: false,
                field:
                  {
                    label: Eigenschaft,
                    name: characteristic,
                    widget: markdown,
                    required: false,
                    default: "",
                  },
              },
              {
                label: Vorstellungstext,
                name: introductionText,
                widget: markdown,
              },
              {
                label: Unterschrift Bild,
                name: signatureImageObject,
                widget: object,
                fields:
                  [
                    { label: Unterschrift Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
            ],
        }
      - {
          label: Bekannt aus,
          name: famousObject,
          widget: object,
          fields:
            [
              { label: Titel, name: tile, widget: markdown },
              {
                label: Logos Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Logos Bild, name: image, widget: image },
                    {
                      label: Logos Bild Mobil,
                      name: mobileImage,
                      widget: image,
                      required: false,
                    },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
            ],
        }
      - {
          label: Textbereich,
          name: textAreaObject,
          widget: object,
          fields:
            [
              { label: Titel, name: title, widget: markdown },
              { label: text, name: text, widget: markdown },
            ],
        }
      - {
          label: Eigenschaften,
          name: featuresList,
          widget: list,
          fields:
            [
              {
                label: Eigenschaft Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Eigenschaft Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              { label: Titel, name: title, widget: markdown },
              { label: Beschreibung, name: description, widget: markdown },
            ],
        }
      - {
          label: Rezensionen,
          name: reviewsObject,
          widget: object,
          fields:
            [
              { label: Titel, name: title, widget: markdown },
              {
                label: Rezensionen Liste,
                name: reviewList,
                widget: list,
                fields:
                  [
                    {
                      label: Rezension Bild,
                      name: imageObject,
                      widget: object,
                      fields:
                        [
                          { label: Rezension Bild, name: image, widget: image },
                          { label: Alternativer Text, name: alt, widget: text },
                        ],
                    },
                  ],
              },
              { label: CTA, name: cta, widget: markdown },
            ],
        }
      - {
          label: Vorteile,
          name: benefitsObject2,
          widget: object,
          fields:
            [
              { label: Titel, name: title, widget: markdown },
              {
                label: Vorteile Liste,
                name: list,
                widget: list,
                fields:
                  [
                    {
                      label: Icon,
                      name: iconName,
                      widget: select,
                      options: [{ label: Herz, value: "heart" }, {label: Doppelpfeil runter, value: "doubleArrowDown" }],
                    },
                    { label: Titel, name: title, widget: markdown },
                    {
                      label: Beschreibung,
                      name: description,
                      widget: markdown,
                    },
                  ],
              },
            ],
        }
      - {
          label: Formular Sektion,
          name: signupObject,
          widget: object,
          fields:
            [
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              { label: Titel, name: title, widget: markdown },
              { label: Untertitel, name: subtitle, widget: markdown },
              { label: CTA, name: cta, widget: markdown },
              {
                label: CTA-Untertitel,
                name: ctaSubtitle,
                widget: markdown,
                required: false,
                default: "",
              },
            ],
        }
      - {
          label: Zitat,
          name: citationObject,
          widget: object,
          fields:
            [
              { label: Zitat, name: citation, widget: markdown },
              { label: Author, name: author, widget: markdown },
            ],
        }

  - label: Upsell Seiten
    name: upsellPages
    folder: "src/pages/upsellPages"
    create: true
    slug: "{{slug}}"
    fields:
      - {
          label: "Template Key",
          name: "templateKey",
          widget: "hidden",
          default: "upsell-page",
        }
      - { label: Interner Titel, name: title, widget: string }
      - {
          label: SEO,
          name: seoObject,
          widget: object,
          fields:
            [
              {
                label: URL-Endung,
                name: slug,
                widget: string,
                pattern:
                  [
                    "^[a-z0-9/]+(?:-[a-z0-9/-]+)*$",
                    'Die URL Endung kann nur aus a-z, 0-9 sowie "/" und "-" bestehen',
                  ],
                hint: "Erlaubte Zeichen: 0-9, a-z, -, /",
              },
              { label: Titel, name: title, widget: string },
              { label: Beschreibung, name: description, widget: text },
              { label: Bild, name: image, widget: image },
              {
                label: Canonical URL,
                name: canonical,
                widget: string,
                required: false,
                default: "",
              },
              {
                label: Bei Google auffindbar?,
                name: index,
                widget: boolean,
                default: true,
              },
            ],
        }
      - {
          label: Kopfzeile,
          name: headerObject,
          widget: object,
          fields:
            [
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
            ],
        }
      - {
          label: Herosektion,
          name: heroObject,
          widget: object,
          fields:
            [
              {
                label: Fortschritt,
                name: progressObject,
                widget: object,
                fields:
                  [
                    { label: Fortschritt Titel, name: title, widget: markdown },
                    { label: Fortschritt %, name: percentage, widget: number },
                  ],
              },
              { label: Titel, name: title, widget: markdown },
              { label: Untertitel, name: subtitle, widget: markdown },
              {
                label: Video,
                name: video,
                widget: object,
                fields:
                  [
                    { label: CloudflareId, name: cloudflareId, widget: string },
                    {
                      label: Platzhalter,
                      name: image,
                      widget: image,
                      required: false,
                    },
                    {
                      label: Format,
                      name: format,
                      widget: select,
                      options: ["Querformat", "Hochformat"],
                      defaul: Querformat,
                    },
                  ],
              },
              { label: CTA, name: ctaPrimary, widget: markdown },
              {
                label: Zweiter CTA,
                name: ctaSecondary,
                widget: markdown,
                required: false,
                default: "",
              },
            ],
        }
      - {
          label: Vorteile,
          name: benefitsObject,
          widget: object,
          fields:
            [
              { label: Titel, name: title, widget: markdown },
              {
                label: Vorteile Liste,
                name: list,
                widget: list,
                fields:
                  [
                    {
                      label: Icon,
                      name: iconName,
                      widget: select,
                      options: [{ label: Herz, value: "heart" }],
                    },
                    { label: Titel, name: title, widget: markdown },
                    {
                      label: Beschreibung,
                      name: description,
                      widget: markdown,
                    },
                  ],
              },
            ],
        }
      - {
          label: Inhalte,
          name: contentsObject,
          widget: object,
          fields:
            [
              { label: Titel, name: title, widget: markdown },
              {
                label: Inhalte Liste,
                name: list,
                widget: list,
                fields:
                  [
                    {
                      label: Inhalt Bild,
                      name: imageObject,
                      widget: object,
                      fields:
                        [
                          { label: Inhalt Bild, name: image, widget: image },
                          { label: Alternativer Text, name: alt, widget: text },
                        ],
                    },
                    { label: Titel, name: title, widget: markdown },
                    {
                      label: Beschreibung,
                      name: description,
                      widget: markdown,
                    },
                  ],
              },
            ],
        }
      - {
          label: Auf einen Blick,
          name: overviewObject,
          widget: object,
          fields:
            [
              { label: Titel, name: title, widget: markdown },
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              {
                label: Liste,
                name: list,
                widget: list,
                fields:
                  [
                    {
                      label: Beschreibung,
                      name: description,
                      widget: markdown,
                    },
                  ],
              },
            ],
        }
      - {
          label: Preis Sektion,
          name: pricingObject,
          widget: object,
          fields:
            [
              { label: Titel, name: title, widget: markdown },
              { label: Untertitel, name: subtitle, widget: markdown },
              {
                label: CTA,
                name: ctaObject,
                widget: object,
                fields:
                  [
                    { label: Link Text, name: linkText, widget: markdown },
                    { label: Link URL, name: linkUrl, widget: string },
                    {
                      label: CTA-Untertitel,
                      name: ctaSubtitle,
                      widget: markdown,
                    },
                  ],
              },
            ],
        }

  - label: Dankes Seiten
    name: thankYouPages
    folder: "src/pages/thankYouPages"
    create: true
    slug: "{{slug}}"
    fields:
      - {
          label: "Template Key",
          name: "templateKey",
          widget: "hidden",
          default: "thank-you-page",
        }
      - { label: Interner Titel, name: title, widget: string }
      - {
          label: SEO,
          name: seoObject,
          widget: object,
          fields:
            [
              {
                label: URL-Endung,
                name: slug,
                widget: string,
                pattern:
                  [
                    "^[a-z0-9/]+(?:-[a-z0-9/-]+)*$",
                    'Die URL Endung kann nur aus a-z, 0-9 sowie "/" und "-" bestehen',
                  ],
                hint: "Erlaubte Zeichen: 0-9, a-z, -, /",
              },
              { label: Titel, name: title, widget: string },
              { label: Beschreibung, name: description, widget: text },
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              {
                label: Canonical URL,
                name: canonical,
                widget: string,
                required: false,
                default: "",
              },
              {
                label: Bei Google auffindbar?,
                name: index,
                widget: boolean,
                default: false,
              },
            ],
        }
      - {
          label: Kopfzeile,
          name: headerObject,
          widget: object,
          fields:
            [
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
            ],
        }
      - {
          label: Herosektion,
          name: heroObject,
          widget: object,
          fields:
            [
              { label: Titel, name: title, widget: markdown },
              { label: Untertitel, name: subtitle, widget: markdown },
              {
                label: Video,
                name: video,
                widget: object,
                fields:
                  [
                    { label: CloudflareId, name: cloudflareId, widget: string },
                    {
                      label: Platzhalter,
                      name: image,
                      widget: image,
                      required: false,
                    },
                    {
                      label: Format,
                      name: format,
                      widget: select,
                      options: ["Querformat", "Hochformat"],
                      default: "Querformat",
                    },
                  ],
              },
            ],
        }
      - {
          label: Schritte,
          name: stepsObject,
          widget: object,
          fields:
            [
              {
                label: Titel,
                name: title,
                widget: markdown,
                required: false,
                default: "",
              },
              {
                label: Schritte,
                name: steps,
                widget: list,
                fields:
                  [
                    {
                      label: Beschreibung,
                      name: description,
                      widget: markdown,
                    },
                    {
                      label: Bild,
                      name: imageObject,
                      widget: object,
                      fields:
                        [
                          {
                            label: Bild,
                            name: image,
                            widget: image,
                            required: false,
                          },
                          {
                            label: Alternativer Text,
                            name: alt,
                            widget: text,
                            required: false,
                            default: "",
                          },
                        ],
                      required: false,
                    },
                    {
                      label: Video,
                      name: video,
                      widget: object,
                      fields:
                        [
                          {
                            label: CloudflareId,
                            name: cloudflareId,
                            widget: string,
                            required: false,
                            default: "",
                          },
                          {
                            label: Platzhalter,
                            name: image,
                            widget: image,
                            required: false,
                          },
                          {
                            label: Format,
                            name: format,
                            widget: select,
                            options: ["Querformat", "Hochformat"],
                            default: "Querformat",
                            required: false,
                          },
                        ],
                      required: false,
                    },
                    {
                      label: Link,
                      name: linkList,
                      widget: list,
                      fields:
                        [
                          {
                            label: Link Text,
                            name: linkText,
                            widget: markdown,
                            required: false,
                            default: "",
                          },
                          {
                            label: Link URL,
                            name: linkUrl,
                            widget: string,
                            required: false,
                            default: "",
                          },
                        ],
                      required: false,
                    },
                  ],
              },
            ],
        }
      - {
          label: Fragen und Antworten,
          name: qAndAObject,
          widget: object,
          required: false,
          fields:
            [
              {
                label: Titel,
                name: title,
                widget: markdown,
                required: false,
                default: "",
              },
              {
                label: Fragen und Antworten,
                name: qAndA,
                widget: list,
                fields:
                  [
                    {
                      label: Frage,
                      name: question,
                      widget: markdown,
                      required: false,
                      default: "",
                    },
                    {
                      label: Antwort,
                      name: answer,
                      widget: markdown,
                      required: false,
                      default: "",
                    },
                  ],
              },
            ],
        }
      - {
          label: Weitere Kurse zeigen?,
          name: showCourses,
          widget: boolean,
          default: true,
        }

  - label: Video Nachrichten Seiten
    name: videoMessagePages
    folder: "src/pages/videoMessagePages"
    create: true
    slug: "{{slug}}"
    fields:
      - {
          label: "Template Key",
          name: "templateKey",
          widget: "hidden",
          default: "video-message-page",
        }
      - { label: Interner Titel, name: title, widget: string }
      - {
          label: SEO,
          name: seoObject,
          widget: object,
          fields:
            [
              {
                label: URL-Endung,
                name: slug,
                widget: string,
                pattern:
                  [
                    "^[a-z0-9/]+(?:-[a-z0-9/-]+)*$",
                    'Die URL Endung kann nur aus a-z, 0-9 sowie "/" und "-" bestehen',
                  ],
                hint: "Erlaubte Zeichen: 0-9, a-z, -, /",
              },
              { label: Titel, name: title, widget: string },
              { label: Beschreibung, name: description, widget: text },
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              {
                label: Canonical URL,
                name: canonical,
                widget: string,
                required: false,
                default: "",
              },
              {
                label: Bei Google auffindbar?,
                name: index,
                widget: boolean,
                default: true,
              },
            ],
        }
      - {
          label: Herosektion,
          name: heroObject,
          widget: object,
          fields:
            [
              { label: Titel, name: title, widget: markdown },
              {
                label: Video,
                name: video,
                widget: object,
                fields:
                  [
                    { label: CloudflareId, name: cloudflareId, widget: string },
                    {
                      label: Platzhalter,
                      name: image,
                      widget: image,
                      required: false,
                    },
                  ],
              },
              {
                label: CTA,
                name: ctaObject,
                widget: object,
                fields:
                  [
                    { label: Link Text, name: linkText, widget: markdown },
                    { label: Link URL, name: linkUrl, widget: string },
                  ],
              },
            ],
        }

  - label: Video Seiten
    name: videoPages
    folder: "src/pages/videoPages"
    create: true
    slug: "{{slug}}"
    fields:
      - {
          label: "Template Key",
          name: "templateKey",
          widget: "hidden",
          default: "video-message-page",
        }
      - { label: Interner Titel, name: title, widget: string }
      - {
          label: SEO,
          name: seoObject,
          widget: object,
          fields:
            [
              {
                label: URL-Endung,
                name: slug,
                widget: string,
                pattern:
                  [
                    "^[a-z0-9/]+(?:-[a-z0-9/-]+)*$",
                    'Die URL Endung kann nur aus a-z, 0-9 sowie "/" und "-" bestehen',
                  ],
                hint: "Erlaubte Zeichen: 0-9, a-z, -, /",
              },
              { label: Titel, name: title, widget: string },
              { label: Beschreibung, name: description, widget: text },
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              {
                label: Canonical URL,
                name: canonical,
                widget: string,
                required: false,
                default: "",
              },
              {
                label: Bei Google auffindbar?,
                name: index,
                widget: boolean,
                default: true,
              },
            ],
        }
      - {
          label: Kopfzeile,
          name: headerObject,
          widget: object,
          required: false,
          fields:
            [
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
            ],
        }
      - {
          label: Herosektion,
          name: heroObject,
          widget: object,
          fields:
            [
              { label: Titel, name: title, widget: markdown },
              {
                label: Video,
                name: video,
                widget: object,
                fields:
                  [
                    { label: CloudflareId, name: cloudflareId, widget: string },
                    {
                      label: Platzhalter,
                      name: image,
                      widget: image,
                      required: false,
                    },
                  ],
              },
              {
                label: CTA,
                name: ctaObject,
                widget: object,
                fields:
                  [
                    { label: Link Text, name: linkText, widget: markdown },
                    { label: Link URL, name: linkUrl, widget: string },
                  ],
              },
            ],
        }

  - label: Teilen Seiten
    name: sharingPages
    folder: "src/pages/sharingPages"
    create: true
    slug: "{{slug}}"
    fields:
      - {
          label: "Template Key",
          name: "templateKey",
          widget: "hidden",
          default: "sharing-page",
        }
      - { label: Interner Titel, name: title, widget: string }
      - {
          label: SEO,
          name: seoObject,
          widget: object,
          fields:
            [
              {
                label: URL-Endung,
                name: slug,
                widget: string,
                pattern:
                  [
                    "^[a-z0-9/]+(?:-[a-z0-9/-]+)*$",
                    'Die URL Endung kann nur aus a-z, 0-9 sowie "/" und "-" bestehen',
                  ],
                hint: "Erlaubte Zeichen: 0-9, a-z, -, /",
              },
              { label: Titel, name: title, widget: string },
              { label: Beschreibung, name: description, widget: text },
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              {
                label: Canonical URL,
                name: canonical,
                widget: string,
                required: false,
                default: "",
              },
              {
                label: Bei Google auffindbar?,
                name: index,
                widget: boolean,
                default: true,
              },
            ],
        }
      - {
          label: Kopfzeile,
          name: headerObject,
          widget: object,
          fields:
            [
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
            ],
        }
      - {
          label: Herosektion,
          name: heroObject,
          widget: object,
          fields:
            [
              {
                label: Fortschritt,
                name: progressObject,
                widget: object,
                fields:
                  [
                    { label: Fortschritt Titel, name: title, widget: markdown },
                    {
                      label: Fortschritt %,
                      name: percentage,
                      widget: number,
                      defaul: 90,
                    },
                  ],
              },
              { label: Titel, name: title, widget: markdown },
              {
                label: Video,
                name: video,
                widget: object,
                fields:
                  [
                    { label: CloudflareId, name: cloudflareId, widget: string },
                    {
                      label: Platzhalter,
                      name: image,
                      widget: image,
                      required: false,
                    },
                    {
                      label: Format,
                      name: format,
                      widget: select,
                      options: ["Querformat", "Hochformat"],
                      default: "Querformat",
                    },
                  ],
              },
              { label: Untertitel, name: subtitle, widget: markdown },
            ],
        }
      - {
          label: Teilensektion,
          name: sharingObject,
          widget: object,
          fields:
            [
              { label: Titel, name: title, widget: markdown },
              { label: Zu teilende Seite, name: linkUrl, widget: string },
              {
                label: Facebook,
                name: facebook,
                widget: object,
                fields:
                  [
                    { label: Teilen Text, name: sharingText, widget: string },
                    { label: Link Text, name: linkText, widget: markdown },
                  ],
              },
              {
                label: WhatsApp,
                name: whatsApp,
                widget: object,
                fields:
                  [
                    { label: Teilen Text, name: sharingText, widget: string },
                    { label: Link Text, name: linkText, widget: markdown },
                  ],
              },
            ],
        }

  - label: Jammerfasten Tages Seiten
    name: dayPages
    folder: "src/pages/dayPages"
    create: true
    slug: "{{slug}}"
    fields:
      - {
          label: "Template Key",
          name: "templateKey",
          widget: "hidden",
          default: "jammerfasten-day-page",
        }
      - { label: Interner Titel, name: title, widget: string }
      - {
          label: SEO,
          name: seoObject,
          widget: object,
          fields:
            [
              {
                label: URL-Endung,
                name: slug,
                widget: string,
                pattern:
                  [
                    "^[a-z0-9/]+(?:-[a-z0-9/-]+)*$",
                    'Die URL Endung kann nur aus a-z, 0-9 sowie "/" und "-" bestehen',
                  ],
                hint: "Erlaubte Zeichen: 0-9, a-z, -, /",
              },
              { label: Titel, name: title, widget: string },
              { label: Beschreibung, name: description, widget: text },
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              {
                label: Canonical URL,
                name: canonical,
                widget: string,
                required: false,
                default: "",
              },
              {
                label: Bei Google auffindbar?,
                name: index,
                widget: boolean,
                default: true,
              },
            ],
        }
      - {
          label: Kopfzeile,
          name: headerObject,
          widget: object,
          fields:
            [
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
            ],
        }
      - {
          label: Herosektion,
          name: heroObject,
          widget: object,
          fields:
            [
              {
                label: Fortschritt,
                name: progressObject,
                widget: object,
                fields:
                  [
                    { label: Fortschritt Titel, name: title, widget: markdown },
                    { label: Fortschritt %, name: percentage, widget: number },
                  ],
              },
              {
                label: Video,
                name: video,
                widget: object,
                fields:
                  [
                    { label: CloudflareId, name: cloudflareId, widget: string },
                    {
                      label: Platzhalter,
                      name: image,
                      widget: image,
                      required: false,
                    },
                    {
                      label: Format,
                      name: format,
                      widget: select,
                      options: ["Querformat", "Hochformat"],
                      default: "Querformat",
                    },
                  ],
              },
              { label: Titel, name: title, widget: markdown },
              { label: Untertitel, name: subtitle, widget: markdown },
              {
                label: Libsyn,
                name: libsynObject,
                widget: object,
                required: false,
                fields:
                  [
                    {
                      label: Titel,
                      name: title,
                      widget: markdown,
                      required: false,
                      default: "",
                    },
                    {
                      label: Untertitel,
                      name: subtitle,
                      widget: markdown,
                      required: false,
                      default: "",
                    },
                    {
                      label: LibsynId,
                      name: LibsynId,
                      widget: string,
                      required: false,
                      default: "",
                    },
                  ],
              },
              {
                label: Beschreibung,
                name: description,
                widget: markdown,
                required: false,
              },
              {
                label: CTA,
                name: cta,
                widget: object,
                fields:
                  [
                    { label: Link Text, name: linkText, widget: markdown },
                    { label: Link URL, name: linkUrl, widget: string },
                  ],
              },
            ],
        }

  - label: Test Seiten
    name: test
    folder: "src/pages/testPages"
    create: true
    slug: "{{slug}}"
    fields:
      - {
          label: "Template Key",
          name: "templateKey",
          widget: "hidden",
          default: "test-page",
        }
      - { label: Interner Titel, name: title, widget: string }
      - {
          label: SEO,
          name: seoObject,
          widget: object,
          fields:
            [
              {
                label: URL-Endung,
                name: slug,
                widget: string,
                pattern:
                  [
                    "^[a-z0-9/]+(?:-[a-z0-9/-]+)*$",
                    'Die URL Endung kann nur aus a-z, 0-9 sowie "/" und "-" bestehen',
                  ],
                hint: "Erlaubte Zeichen: 0-9, a-z, -, /",
              },
              { label: Titel, name: title, widget: string },
              { label: Beschreibung, name: description, widget: text },
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
              {
                label: Canonical URL,
                name: canonical,
                widget: string,
                required: false,
                default: "",
              },
              {
                label: Bei Google auffindbar?,
                name: index,
                widget: boolean,
                default: true,
              },
            ],
        }
      - {
          label: Kopfzeile,
          name: headerObject,
          widget: object,
          fields:
            [
              {
                label: Bild,
                name: imageObject,
                widget: object,
                fields:
                  [
                    { label: Bild, name: image, widget: image },
                    { label: Alternativer Text, name: alt, widget: text },
                  ],
              },
            ],
        }
      - { label: Description, name: description, widget: string }
martinjagodic commented 1 year ago

Closing as stale.