Skip to content
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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Add basic CMS for Dummy site template #6

wants to merge 8 commits into from

Conversation

frederickobrien
Copy link
Member

@frederickobrien frederickobrien commented Jan 9, 2025

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:

  • Articles
  • Authors

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:

Copy link

netlify bot commented Jan 9, 2025

Deploy Preview for gonzo-dummy-template ready!

Name Link
🔨 Latest commit 0412319
🔍 Latest deploy log https://app.netlify.com/sites/gonzo-dummy-template/deploys/67b1d29e23450700081279c5
😎 Deploy Preview https://deploy-preview-6--gonzo-dummy-template.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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}}"
Copy link
Member Author

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"] }
Copy link
Member Author

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" }] }
Copy link
Member Author

@frederickobrien frederickobrien Jan 12, 2025

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.

@frederickobrien frederickobrien changed the title CMS Add basic CMS for Dummy site template Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant