Skip to content

Commit 7a06d4f

Browse files
fix(cms): restore hub bindings lost in PR 65 merge resolution (#66)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent d3ce126 commit 7a06d4f

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

admin/config.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ collections:
319319
- name: image
320320
label: "Illustration"
321321
widget: image
322-
media_folder: /assets/images/undraw
323-
public_folder: /assets/images/undraw
322+
media_folder: /assets/images/hub
323+
public_folder: /assets/images/hub
324324
choose_url: false
325325
max_file_size: 2097152
326326
accept: "image/jpeg,image/png,image/svg+xml,image/webp"
@@ -564,8 +564,8 @@ collections:
564564
- name: image
565565
label: "Illustration"
566566
widget: image
567-
media_folder: /assets/images/undraw
568-
public_folder: /assets/images/undraw
567+
media_folder: /assets/images/hub
568+
public_folder: /assets/images/hub
569569
choose_url: false
570570
max_file_size: 2097152
571571
accept: "image/jpeg,image/png,image/svg+xml,image/webp"
@@ -739,8 +739,8 @@ collections:
739739
- name: image
740740
label: "Illustration"
741741
widget: image
742-
media_folder: /assets/images/undraw
743-
public_folder: /assets/images/undraw
742+
media_folder: /assets/images/hub
743+
public_folder: /assets/images/hub
744744
choose_url: false
745745
max_file_size: 2097152
746746
accept: "image/jpeg,image/png,image/svg+xml,image/webp"
@@ -1234,8 +1234,8 @@ collections:
12341234
- name: image
12351235
label: "Illustration"
12361236
widget: image
1237-
media_folder: /assets/images/undraw
1238-
public_folder: /assets/images/undraw
1237+
media_folder: /assets/images/hub
1238+
public_folder: /assets/images/hub
12391239
choose_url: false
12401240
max_file_size: 2097152
12411241
accept: "image/jpeg,image/png,image/svg+xml,image/webp"
@@ -1253,8 +1253,8 @@ collections:
12531253
- name: image
12541254
label: "Illustration"
12551255
widget: image
1256-
media_folder: /assets/images/undraw
1257-
public_folder: /assets/images/undraw
1256+
media_folder: /assets/images/hub
1257+
public_folder: /assets/images/hub
12581258
choose_url: false
12591259
max_file_size: 2097152
12601260
accept: "image/jpeg,image/png,image/svg+xml,image/webp"

cms/maintainer-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ How the admin look-and-feel is configured (all in `admin/config.yml` unless note
4040
- **Entry-list views (News)**: `thumbnail: image` (grid view shows the news image), date-descending default sort, optional year grouping (no default).
4141
- **"View on Live Site"** (the ⋯ menu in the entry editor): needs `preview_path` on the collection because Sveltia can't infer Jekyll permalinks — set to the permalink pattern with `{{filename}}` standing in for `:path` (see the Events and News collections). Resolves against `site_url`, i.e. staging. Entry collections only; file-collection page editors have no per-file equivalent.
4242
- **Body-image tidiness**: Events and News set collection-level `media_folder`/`public_folder` so images inserted into entry bodies land in `/assets/images/events` and `/assets/images/news` rather than the global root.
43-
- **unDraw illustration bank**: `assets/images/undraw/` holds ~320 unDraw SVGs pre-colored in the three brand accents, named `undraw_<title>_<blue|coral|yellow>.svg`. The Asset Library only shows folders referenced somewhere in the config, so the bank is bound as the `media_folder` of the illustration image fields (hub-page heroes, journey steps, Networks sections) — that gives it its own folder in the Asset Library (instead of polluting the global view) and makes those fields' image picker open straight into it. To grow the bank: a supporter saves undraw.co gallery pages with the brand color applied and the SVGs get extracted from the inline HTML (`fill="currentColor"` must be replaced with the page's hex or the files render black standalone).
43+
- **unDraw illustration bank**: `assets/images/undraw/` holds ~320 unDraw SVGs pre-colored in the three brand accents, named `undraw_<title>_<blue|coral|yellow>.svg`. It is declared as an **asset collection** (`asset_collections:` in admin/config.yml), which gives it its own folder in the Asset Library and makes it a selectable source in every image field's picker. Caveats: (1) asset collections landed upstream 2026-06-12 (sveltia-cms#301) and need a Sveltia release newer than v0.166.3 — until then the key is ignored and the bank is simply part of the global pool (search "undraw"); (2) do NOT instead bind the folder to specific fields' `media_folder` — a field-scoped folder is invisible to every *other* field's picker (tried; locked the bank away from news images). To grow the bank: a supporter saves undraw.co gallery pages with the brand color applied, and the inline SVGs are extracted with `fill="currentColor"` replaced by the page's hex (otherwise they render black standalone).
4444
- **Preview pane**: `admin/index.html` registers `admin/preview.css` via `CMS.registerPreviewStyle()` so entry previews use site typography (self-contained `@font-face` for the self-hosted Nunito fonts plus tokens copied from `_sass/_variables.scss` — keep in sync by hand). Data-list file editors set `editor: { preview: false }` because a preview of a raw YAML list is noise.
4545

4646
## Why PATs instead of OAuth (background)

0 commit comments

Comments
 (0)