From 5eca438083bd1fb3521a0c732ec2c1836b8f76fb Mon Sep 17 00:00:00 2001 From: Jacob Brooks Date: Fri, 15 May 2026 11:08:08 -0700 Subject: [PATCH 1/2] feat: add Sveltia CMS admin UI Adds /admin with Sveltia CMS (Decap-compatible, no OAuth backend needed). Supports creating/editing posts with image uploads from mobile browser. - admin/index.html: loads Sveltia CMS from CDN - admin/config.yml: configured for _posts collection with existing front matter fields (title, subtitle, tags, cover-img, comments) - Images upload to assets/img/uploads/ Co-Authored-By: Claude Sonnet 4.6 --- admin/config.yml | 41 +++++++++++++++++++++++++++++++++++++++++ admin/index.html | 12 ++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 admin/config.yml create mode 100644 admin/index.html diff --git a/admin/config.yml b/admin/config.yml new file mode 100644 index 000000000000..85142e841ab1 --- /dev/null +++ b/admin/config.yml @@ -0,0 +1,41 @@ +backend: + name: github + repo: jlbrooks/jlbrooks.github.io + branch: master + +# Images uploaded via the editor go here +media_folder: assets/img/uploads +public_folder: /assets/img/uploads + +collections: + - name: posts + label: Posts + folder: _posts + create: true + slug: "{{year}}-{{month}}-{{day}}-{{slug}}" + editor: + preview: false + fields: + - { label: Layout, name: layout, widget: hidden, default: post } + - { label: Title, name: title, widget: string } + - { label: Subtitle, name: subtitle, widget: string, required: false } + - label: Tags + name: tags + widget: select + multiple: true + required: false + options: + - trip-report + - skiing + - hiking + - weekly-whats-up + - home-automation + - travel + - tech + - label: Cover Image + name: cover-img + widget: image + required: false + hint: "Optional hero image shown at top of post" + - { label: Comments, name: comments, widget: boolean, default: true } + - { label: Body, name: body, widget: markdown } diff --git a/admin/index.html b/admin/index.html new file mode 100644 index 000000000000..add51b72bdfc --- /dev/null +++ b/admin/index.html @@ -0,0 +1,12 @@ + + + + + + + Content Manager + + + + + From 83aa342a6b8fd929d4ad7411a1ae0acbc3e8e44f Mon Sep 17 00:00:00 2001 From: Jacob Brooks Date: Fri, 15 May 2026 11:10:33 -0700 Subject: [PATCH 2/2] fix: scope image uploads to per-post folder matching existing convention Moves media_folder/public_folder into the posts collection with slug template vars so images land in assets/img/YYYY-MM-DD-post-title/ instead of a flat uploads folder. Co-Authored-By: Claude Sonnet 4.6 --- admin/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/config.yml b/admin/config.yml index 85142e841ab1..148209b916ee 100644 --- a/admin/config.yml +++ b/admin/config.yml @@ -3,16 +3,16 @@ backend: repo: jlbrooks/jlbrooks.github.io branch: master -# Images uploaded via the editor go here -media_folder: assets/img/uploads -public_folder: /assets/img/uploads - collections: - name: posts label: Posts folder: _posts create: true slug: "{{year}}-{{month}}-{{day}}-{{slug}}" + # Images go in a per-post folder matching the existing convention: + # assets/img/YYYY-MM-DD-post-title/ + media_folder: "assets/img/{{year}}-{{month}}-{{day}}-{{slug}}" + public_folder: "/assets/img/{{year}}-{{month}}-{{day}}-{{slug}}" editor: preview: false fields: