Decap CMS Configuration

Files

File Purpose
public/admin/index.html Staff workspace (/admin/): a static task dashboard. Each card deep-links into the editor (for example /admin/edit/#/collections/events/entries/event_list). Includes a publishing explainer and a help section. No Decap code loads here.
public/admin/workspace.css Styles for the workspace and the editor loading screen
public/admin/workspace.js Redirects old Decap bookmarks (/admin/#/…) to /admin/edit/#/…
public/admin/edit/index.html Editor (/admin/edit/): points Decap at /admin/config.yml via <link rel="cms-config-url">, shows a loading screen, and mounts Decap into #nc-root
public/admin/editor-loader.js Injects Decap from unpkg, pinned to decap-cms@3.8.4. Hides the loading screen once Decap renders. After 20 s shows a slow-connection message, or an error message if the script fails to load.
public/admin/config.yml Backend, media folders, and collections

All admin pages are noindex, nofollow, and robots disallows /admin.

To upgrade Decap, change the pinned version in editor-loader.js, then test sign-in and every collection locally (npx decap-server) before deploying. An unpkg outage affects only the editor, never the public site.

The workspace cards hard-code collection and file names in their URLs. If you rename a collection or file entry in config.yml, update the matching card link in index.html.

Backend and authentication

backend:
  name: github
  repo: pmgasset/fortadamswebsite
  branch: main
  base_url: https://decap-oauth.fortadams.org   # OAuth proxy
local_backend: true
site_url: https://www.fortadams.org

Collections

The header comment in config.yml says it: keep collection, file, and field names stable, because they map to existing JSON keys and paths. Labels can change freely.

Collection label (name) File entry label (name) Target Media folder
Special Events (events) Add or update events (event_list) content/events.json public/images/events
Event Categories (event_categories) content/event-categories.json
Alerts & Booking (settings) Update the announcement banner (alert) content/alert.json global: public/images/staff
Update tour booking links (tour_booking) content/tour-booking.json
Staff & Board (staff) Update staff & board (directory) content/staff.json global: public/images/staff
Sponsors & Partners (sponsors) Update sponsor recognition (annual_sponsors) content/sponsors.json public/images/sponsors

All collections are file collections (one JSON file each, with list widgets) and set delete: false, so editors can't delete the underlying files. Global options: editor.preview: false (no preview pane), logo_url (the Trust logo on the login screen), and display_url pointing at /admin/. Lists are collapsed: true, required: false, default: [].

Notable field configuration:

Adding a CMS-editable field or area

  1. Add the field to the JSON file in content/ with a sensible default, so existing data stays valid.
  2. Update the TypeScript interface and loader in src/lib/, treating the field as optional for older data.
  3. Add the widget to config.yml. Mirror the constraints with pattern, required, and hint.
  4. Render it in the component.
  5. Test locally with npx decap-server (see Local Development Setup), then npm run build.

Keep new areas constrained: validated strings, booleans, lists, and images. Avoid rich-text or HTML fields that let editors break layouts or inject markup.


Revision #1
Created 2026-09-28 14:25:57 UTC by David Prata
Updated 2026-09-28 14:25:57 UTC by David Prata