From 869e3e00d2de063ffdf9a270a7532e0d871deff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Mon, 18 May 2026 18:48:27 +0200 Subject: [PATCH] Replace data/issues.json with content/_index.md files per issue Issue metadata (title, description, season, status) now lives in content/issues/XX/_index.md. terms.html reads from those pages via $.Site.GetPage, driven by issueIds param in hugo.toml. Removes the JSON data file and its generation from import-posts.py. Co-Authored-By: Claude Sonnet 4.6 --- content/issues/02/_index.md | 7 +++++++ content/issues/03/_index.md | 7 +++++++ data/issues.json | 29 ----------------------------- hugo.toml | 1 + layouts/issues/terms.html | 24 ++++++++++++------------ scripts/import-posts.py | 36 ------------------------------------ 6 files changed, 27 insertions(+), 77 deletions(-) create mode 100644 content/issues/02/_index.md create mode 100644 content/issues/03/_index.md delete mode 100644 data/issues.json diff --git a/content/issues/02/_index.md b/content/issues/02/_index.md new file mode 100644 index 0000000..6047484 --- /dev/null +++ b/content/issues/02/_index.md @@ -0,0 +1,7 @@ +--- +title: "The Glasshouse" +description: "A study in transparency, condensation, and the long late light of June." +issueNumber: "№ 02" +season: "Summer MMXXVI" +status: "forthcoming" +--- diff --git a/content/issues/03/_index.md b/content/issues/03/_index.md new file mode 100644 index 0000000..f505c1e --- /dev/null +++ b/content/issues/03/_index.md @@ -0,0 +1,7 @@ +--- +title: "Atelier After Hours" +description: "The slow work of cloth and thread, photographed when the studio is half-empty." +issueNumber: "№ 03" +season: "Autumn MMXXVI" +status: "forthcoming" +--- diff --git a/data/issues.json b/data/issues.json deleted file mode 100644 index 8f0e6ef..0000000 --- a/data/issues.json +++ /dev/null @@ -1,29 +0,0 @@ -[ - { - "id": "01", - "number": "\u2116 01", - "title": "Fabric, Light & Gesture", - "season": "Spring MMXXVI", - "publishedAt": "2026-03-21", - "blurb": "The inaugural plates \u2014 one hundred photographs gathered across ateliers, streets, and quiet hotel corridors.", - "status": "current" - }, - { - "id": "02", - "number": "\u2116 02", - "title": "The Glasshouse", - "season": "Summer MMXXVI", - "publishedAt": "2026-06-21", - "blurb": "Forthcoming \u2014 a study in transparency, condensation, and the long late light of June.", - "status": "forthcoming" - }, - { - "id": "03", - "number": "\u2116 03", - "title": "Atelier After Hours", - "season": "Autumn MMXXVI", - "publishedAt": "2026-09-22", - "blurb": "Forthcoming \u2014 the slow work of cloth and thread, photographed when the studio is half-empty.", - "status": "forthcoming" - } -] \ No newline at end of file diff --git a/hugo.toml b/hugo.toml index d5f2445..75a8894 100644 --- a/hugo.toml +++ b/hugo.toml @@ -21,6 +21,7 @@ term = ["HTML"] [params] description = "Roux is a slow-publishing fashion journal — one hundred photographs at a time. Editorial, couture, beauty and backstage plates." author = "Roux Editorial" +issueIds = ["01", "02", "03"] issueNumber = "01" issueName = "Fabric, Light & Gesture" issueSeason = "Spring MMXXVI" diff --git a/layouts/issues/terms.html b/layouts/issues/terms.html index 64cb020..fc6b0db 100644 --- a/layouts/issues/terms.html +++ b/layouts/issues/terms.html @@ -1,5 +1,4 @@ {{ define "main" }} -{{- $issues := .Site.Data.issues }}
Archive · Every issue

The issues

@@ -9,11 +8,13 @@
- {{- range $i, $iss := $issues }} + {{- range $i, $id := $.Site.Params.issueIds }} + {{- $iss := $.Site.GetPage (printf "/issues/%s" $id) }} + {{- if not $iss }}{{- continue }}{{- end }} + {{- $isCurrent := eq $iss.Params.status "current" }} + {{- $isForth := eq $iss.Params.status "forthcoming" }} + {{- $issueURL := printf "/issues/%s/" $id }} {{- $delay := mul $i 80 }} - {{- $isCurrent := eq $iss.status "current" }} - {{- $isForth := eq $iss.status "forthcoming" }} - {{- $issueURL := printf "/issues/%s/" $iss.id }} {{- if $isForth }}
{{- else }} - {{- $termPage := $.Site.GetPage (printf "/issues/%s" $iss.id) }} - {{- $firstPost := cond (ne $termPage nil) (index $termPage.Pages 0) nil }} + {{- $firstPost := index $iss.Pages 0 }} {{- if $firstPost }} {{- $img := $firstPost.Resources.GetMatch "*.png" }} {{- if $img }} {{- $cover := $img.Resize "480x720 webp" }} - Issue {{ $iss.number }} cover {{- end }} @@ -51,11 +51,11 @@
{{/* Metadata */}} -
{{ $iss.number }}
-

{{ $iss.title }}

-

{{ $iss.blurb }}

+
{{ $iss.Params.issueNumber }}
+

{{ $iss.Title }}

+

{{ $iss.Params.description }}

- {{ $iss.season }} + {{ $iss.Params.season }} {{- if $isCurrent }} Read the issue → {{- else if $isForth }} diff --git a/scripts/import-posts.py b/scripts/import-posts.py index f2b0ac6..2f0b613 100644 --- a/scripts/import-posts.py +++ b/scripts/import-posts.py @@ -5,7 +5,6 @@ Only imports posts whose generated_image exists in the selected images folder. Run from the site root: python3 scripts/import-posts.py """ import csv -import json import os import shutil from pathlib import Path @@ -15,10 +14,8 @@ CSV_PATH = GINGER / "posts.csv" IMG_DIR = GINGER / "images" / "final" / "selected" SITE = Path(__file__).parent.parent CONTENT = SITE / "content" / "posts" -DATA_DIR = SITE / "data" CONTENT.mkdir(parents=True, exist_ok=True) -DATA_DIR.mkdir(parents=True, exist_ok=True) # Collect available images available = {f.name for f in IMG_DIR.iterdir() if f.is_file()} @@ -82,36 +79,3 @@ tags: (bundle / "index.md").write_text(md, encoding="utf-8") print(f"Created {len(matched)} page bundles in {CONTENT}") - -# Write data/issues.json -issues = [ - { - "id": "01", - "number": "№ 01", - "title": "Fabric, Light & Gesture", - "season": "Spring MMXXVI", - "publishedAt": "2026-03-21", - "blurb": "The inaugural plates — one hundred photographs gathered across ateliers, streets, and quiet hotel corridors.", - "status": "current" - }, - { - "id": "02", - "number": "№ 02", - "title": "The Glasshouse", - "season": "Summer MMXXVI", - "publishedAt": "2026-06-21", - "blurb": "Forthcoming — a study in transparency, condensation, and the long late light of June.", - "status": "forthcoming" - }, - { - "id": "03", - "number": "№ 03", - "title": "Atelier After Hours", - "season": "Autumn MMXXVI", - "publishedAt": "2026-09-22", - "blurb": "Forthcoming — the slow work of cloth and thread, photographed when the studio is half-empty.", - "status": "forthcoming" - } -] -(DATA_DIR / "issues.json").write_text(json.dumps(issues, indent=2), encoding="utf-8") -print("Wrote data/issues.json")