-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic CMS for Dummy site template #6
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for gonzo-dummy-template ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
folder: "src/data/articles" | ||
create: true | ||
# slug: "{{year}}-{{month}}-{{day}}-{{slug}}" | ||
slug: "{{fields.slug}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures the slug and the file name stay in sync. Documentation: https://decapcms.org/docs/configuration-options/#slug
- { label: "Featured image caption", name: "featuredImageCaption", widget: "string" } | ||
- { label: "Publication date", name: "publicationDate", widget: "datetime" } | ||
- { label: "Authors", name: "authors", widget: "list", fields: [{ label: "Author", name: "slug", widget: "relation", collection: "authors", searchFields: ["name"], valueField: "slug" }] } | ||
- { label: "Section", name: "section", widget: "select", options: ["new-town", "business-district", "old-town"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation: https://decapcms.org/docs/widgets/#select
Might be worth making this customisable somewhere in the CMS itself, though unlikely to change often once site is set up.
- { label: "Featured image alt text", name: "featuredImageAltText", widget: "string" } | ||
- { label: "Featured image caption", name: "featuredImageCaption", widget: "string" } | ||
- { label: "Publication date", name: "publicationDate", widget: "datetime" } | ||
- { label: "Authors", name: "authors", widget: "list", fields: [{ label: "Author", name: "slug", widget: "relation", collection: "authors", searchFields: ["name"], valueField: "slug" }] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation: https://decapcms.org/docs/widgets/#relation
This is lovely functionality from Decap, allows for interweaving of articles and author data.
The remaining piece of the puzzle. Getting this working properly makes Dummy sound as a standalone template that can be set up in minutes, i.e. v1 ready. This implements a basic content managements system so users can handle content, media, and other key data.
Using Decap with authorisation set in Netlify.
The data breaks down in to the following collections:
Using the relation Decap widget article and author can be independent of each other while staying in sync.
This seemed like a good excuse to add author pages so that's been done too.
The PR also includes some import and type fixes to fit with the standalone Gonzo packages approach (#4).
Pending/to explore: