From ac21bd93b605e3a20bf12f4b98ec2263844a98bd Mon Sep 17 00:00:00 2001 From: Paul Nicholsen Date: Wed, 5 Aug 2026 17:12:00 -0400 Subject: [PATCH 1/7] Update Decap CMS script version in index.html --- src/admin/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/admin/index.html b/src/admin/index.html index b57df21a..718deb71 100644 --- a/src/admin/index.html +++ b/src/admin/index.html @@ -13,7 +13,7 @@ - + From c8db8a9323e9b3245eee0fb9b8c5f652616ac172 Mon Sep 17 00:00:00 2001 From: Paul Nicholsen Date: Sun, 9 Aug 2026 08:50:06 -0400 Subject: [PATCH 2/7] use decap react --- package-lock.json | 4 ++++ src/admin/index.html | 46 +++++++++++++++++++++----------------------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 10238536..1124da26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2162,6 +2162,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.10.44", "caniuse-lite": "^1.0.30001806", @@ -5170,6 +5171,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -5245,6 +5247,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "nanoid": "^3.3.16", "picocolors": "^1.1.1", @@ -5691,6 +5694,7 @@ "resolved": "https://registry.npmjs.org/posthtml/-/posthtml-0.16.7.tgz", "integrity": "sha512-7Hc+IvlQ7hlaIfQFZnxlRl0jnpWq2qwibORBhQYIb0QbNtuicc5ZxvKkVT71HJ4Py1wSZ/3VR1r8LfkCtoCzhw==", "license": "MIT", + "peer": true, "dependencies": { "posthtml-parser": "^0.11.0", "posthtml-render": "^3.0.0" diff --git a/src/admin/index.html b/src/admin/index.html index 718deb71..f318e870 100644 --- a/src/admin/index.html +++ b/src/admin/index.html @@ -5,10 +5,6 @@ - - - - Content Manager @@ -18,7 +14,9 @@ - - - - - - - + + + + + + + Content Manager + + + + + + + + + diff --git a/src/admin/previews.jsx b/src/admin/previews.jsx new file mode 100644 index 00000000..8d65ef12 --- /dev/null +++ b/src/admin/previews.jsx @@ -0,0 +1,83 @@ +/** @jsx h */ +/* ^ Compile JSX with Decap's own renderer instead of React.createElement */ + +/* + Preview Pane Templates + ============================================ + + Edit this file to customize the preview pane for your collections. + Documentation: https://decapcms.org/docs/customization/ + + At the bottom of the file, we load the same stylesheets used on the site. + Therefore, please keep the HTML in the preview in-sync with what's used on + the site to ensure the previews work correctly. +*/ + +const { createClass, h } = window; + +/* Resolve an image path to a URL. Unsaved uploads only exist as blobs. */ +function assetUrl(getAsset, path) { + if (!path || typeof path !== "string") return ""; + try { + const asset = getAsset(path); + return asset ? asset.toString() : ""; + } catch (error) { + return path; + } +} + +/* Mirror of the site's postDate filter (src/config/filters/postDate.js) */ +function postDate(value) { + if (!value) return ""; + const date = value instanceof Date ? value : new Date(value); + if (isNaN(date.getTime())) return ""; + return new Intl.DateTimeFormat(undefined, { + year: "numeric", + month: "short", + day: "numeric" + }).format(date); +} + +/* Mirrors the blog layout's markup so the preview reuses the site's CSS */ +const BlogPreview = createClass({ + render: function () { + /* Live form values, re-rendered on every keystroke */ + const data = this.props.entry.get("data").toJS(); + const cover = assetUrl(this.props.getAsset, data.image); + + return ( +
+
+
+
+ + + +
+

{data.title}

+
+ + + + {data.author} + + {postDate(data.date)} +
+
+
+ {this.props.widgetFor("body")} +
+
+
+
+
+ ); + } +}); + +/* Bind the template to the "blog" collection in config.yml */ +CMS.registerPreviewTemplate("blog", BlogPreview); + +/* The preview renders in a bare iframe, so pull in the site's stylesheets */ +CMS.registerPreviewStyle("/assets/css/root.css"); +CMS.registerPreviewStyle("/assets/css/blog.css"); \ No newline at end of file From e9b61b89a9f1d26c105ba5d0ffd38bc64b0db2cb Mon Sep 17 00:00:00 2001 From: Ethan Date: Tue, 11 Aug 2026 13:03:42 +0100 Subject: [PATCH 4/7] updating README --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ba2c2780..ba263c61 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,6 @@ This documentation will explain all the files and directories in the starter kit │ │ └── sections/ │ ├── admin/ │ │ ├── config.yml -│ │ ├── decap-preview-styles.css │ │ ├── index.html │ │ └── previews.jsx │ ├── assets/ @@ -302,17 +301,17 @@ Styling the Decap preview pane This template includes custom styles for the Deca 1. How it works: -The preview styles are defined in /admin/decap-preview-styles.css. The CMS preview script in /admin/previews.jsx: +The preview styles are pulled from the same styles that are defined in your production styles, so make sure that you keep the JSX in sync for a true "live editing" experience. The CMS preview script can be found in in /admin/previews.jsx: - pulls the props from the collection - creates the DOM elements - registers these elements and styles for the preview panel to use -The templates are written in JSX and compiled in the browser by @babel/standalone, which /admin/index.html loads before it loads previews.jsx. Keep them in their own .jsx file rather than inlining them in index.html - HTML formatters lowercase component tags such as `` into ``, which silently breaks the previews. +The templates are written in JSX and compiled in the browser by @babel/standalone, which /admin/index.html loads before it loads previews.jsx. Keep them in their own .jsx file rather than inlining them in index.html to prevent formatters as treating them as HTML. 2. How to update or customize: -Edit /admin/decap-preview-styles.css and /admin/previews.jsx to match your site's branding or layout changes. Use Decap's documentation on [customizing the preview pane](https://decapcms.org/docs/customization/) +Edit /admin/previews.jsx to match your site's branding or layout changes. Use Decap's documentation on [customizing the preview pane](https://decapcms.org/docs/customization/) 3.Notes From d67cde7cfe35234beffa07320720ce86d843f934 Mon Sep 17 00:00:00 2001 From: Ethan Date: Tue, 11 Aug 2026 13:04:00 +0100 Subject: [PATCH 5/7] Revert package-lock.json changes Only incidental npm metadata, no dependency changes. Co-Authored-By: Claude Opus 5 (1M context) --- package-lock.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1124da26..10238536 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2162,7 +2162,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.10.44", "caniuse-lite": "^1.0.30001806", @@ -5171,7 +5170,6 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -5247,7 +5245,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.16", "picocolors": "^1.1.1", @@ -5694,7 +5691,6 @@ "resolved": "https://registry.npmjs.org/posthtml/-/posthtml-0.16.7.tgz", "integrity": "sha512-7Hc+IvlQ7hlaIfQFZnxlRl0jnpWq2qwibORBhQYIb0QbNtuicc5ZxvKkVT71HJ4Py1wSZ/3VR1r8LfkCtoCzhw==", "license": "MIT", - "peer": true, "dependencies": { "posthtml-parser": "^0.11.0", "posthtml-render": "^3.0.0" From 53e7b097375a929080196ac33087518ea832f704 Mon Sep 17 00:00:00 2001 From: Ethan Date: Tue, 11 Aug 2026 13:14:15 +0100 Subject: [PATCH 6/7] commenting --- src/admin/index.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/admin/index.html b/src/admin/index.html index a3b5308d..9f7da66c 100644 --- a/src/admin/index.html +++ b/src/admin/index.html @@ -4,17 +4,16 @@ - Content Manager - + - + From 5fd1d20ec89b478bf68c2e84ae2bdb29a43592d3 Mon Sep 17 00:00:00 2001 From: Geoffrey Le Meur Date: Tue, 11 Aug 2026 14:35:22 +0200 Subject: [PATCH 7/7] reintroduces default date that was removed in a Decap update --- src/admin/config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/admin/config.yml b/src/admin/config.yml index edb50c01..d9f3ac64 100644 --- a/src/admin/config.yml +++ b/src/admin/config.yml @@ -29,7 +29,12 @@ collections: } - { label: "Description", name: "description", widget: "string" } - { label: "Author", name: "author", widget: "string" } - - { label: "Date", name: "date", widget: "datetime" } + - { + label: "Date", + name: "date", + widget: "datetime", + default: "{{now}}", + } - { label: "Tags", name: "tags", widget: "list", default: ["post"] } - { label: "Featured Image", name: "image", widget: "image" } - { label: "Image Caption", name: "imageAlt", widget: "string" }