diff --git a/AGENTS.md b/AGENTS.md index 33ff4b2..508aa2d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,7 +35,8 @@ make theme-update # bump the PaperMod submodule, then review + `make check` make new-project # reminder: add an entry to data/projects.yaml ``` -`make check` is the definition of done. It fails if there is no project card, +`make check` is the definition of done. It fails if no project entry or project +image is rendered, if an entry does not cover "Die Idee" and "Die Umsetzung", if the Berlin Crime Stories entry disappears, if the Über mich / Impressum / Datenschutz pages are missing, if placeholder text or a dev base URL leaks into `public/`, or if an internal link does not resolve. @@ -46,9 +47,10 @@ Datenschutz pages are missing, if placeholder text or a dev base URL leaks into | --- | --- | | `config.yml` | Site config: title, language, params, footer text, analytics | | `content/_index.md` | Landing page copy (intro, `{{< projects >}}`, contact) | -| `data/projects.yaml` | **Project list.** One entry per card, order = page order | +| `data/projects.yaml` | **Project list.** One entry per project, order = page order | | `layouts/shortcodes/projects.html` | Renders + validates the cards from the data file | -| `layouts/_partials/extend_head.html` | Card CSS, home page only | +| `layouts/_partials/extend_head.html` | Project entry CSS, home page only | +| `assets/projects/` | Project images, processed by Hugo into 800 px WebP | | `content/about.md` | "Über mich" page, must stay (menu + landing page link to it) | | `content/impressum.md`, `content/data_protection.md` | Legal pages, must stay | | `layouts/shortcodes/obfuscate.html` | Base64 email obfuscation shortcode | @@ -62,14 +64,21 @@ Edit `data/projects.yaml`. Fields: - `name` — display name, required - `url` — absolute `https://` URL, required -- `description` — one or two German sentences for the card, required +- `description` — long-form Markdown, required: **the idea and the technical + implementation**, ~250–400 words (1–2 minutes), German +- `image` — path inside `assets/`, e.g. `projects/foo.jpg`, required. Use an + image from the project itself; Hugo resizes it to 800 px WebP +- `image_alt` — short German alt text (strongly recommended) +- `image_credit` — small caption under the image (optional) - `status` — short badge, e.g. `live`, `beta`, `in Arbeit` (optional) - `tags` — short labels (optional) Put new projects at the top. The shortcode calls `errorf` when a required field -is missing or the URL is not absolute, so a broken entry fails the build instead -of shipping an empty card. Do not create per-project Hugo pages — the card links -out to the project's own site. Card styling lives in +is missing, the URL is not absolute, or the image does not exist under `assets/`, +so a broken entry fails the build instead of shipping a half-empty entry. +`description` uses `|` in YAML to keep blank lines; it is rendered as Markdown +(`**bold**`, paragraphs) inside the entry. Do not create per-project Hugo pages — +the entry links out to the project's own site. Styling lives in `layouts/_partials/extend_head.html`; keep using PaperMod CSS variables (`--entry`, `--border`, `--secondary`, ...) so light/dark mode keeps working. diff --git a/Makefile b/Makefile index f65e473..d8c70d2 100644 --- a/Makefile +++ b/Makefile @@ -34,8 +34,12 @@ check: build ## Build, then verify the generated site @test -f public/about/index.html @test -f public/impressum/index.html @test -f public/data_protection/index.html - @grep -q 'project-card' public/index.html \ - || { echo "FAIL: no project cards rendered (data/projects.yaml?)"; exit 1; } + @grep -q 'class=project' public/index.html \ + || { echo "FAIL: no project entries rendered (data/projects.yaml?)"; exit 1; } + @grep -q 'project-media' public/index.html \ + || { echo "FAIL: project entry is missing its image"; exit 1; } + @grep -q 'Die Idee' public/index.html && grep -q 'Die Umsetzung' public/index.html \ + || { echo "FAIL: project description must cover the idea and the implementation"; exit 1; } @grep -q 'berlin-crime.poweronoff.click' public/index.html \ || { echo "FAIL: Berlin Crime Stories missing from the landing page"; exit 1; } @! grep -rl "Lorem Ipsum\|dolor sit amet\|TODO: body\.\|TODO: intro paragraph" public --include='*.html' \ diff --git a/README.md b/README.md index f123456..1f51b19 100644 --- a/README.md +++ b/README.md @@ -17,5 +17,6 @@ make serve # preview on http://localhost:1313 make check # build + project/content/link checks ``` -Add a project by appending an entry to `data/projects.yaml` and running -`make check`. See [AGENTS.md](AGENTS.md) for conventions and guardrails. +Add a project by appending an entry to `data/projects.yaml` (name, URL, a +1–2 minute description of idea + implementation, and an image under +`assets/`) and running `make check`. See [AGENTS.md](AGENTS.md) for conventions and guardrails. diff --git a/assets/projects/berlin-crime-stories.jpg b/assets/projects/berlin-crime-stories.jpg new file mode 100644 index 0000000..cccfbd4 Binary files /dev/null and b/assets/projects/berlin-crime-stories.jpg differ diff --git a/data/projects.yaml b/data/projects.yaml index 19de07b..9de8ac4 100644 --- a/data/projects.yaml +++ b/data/projects.yaml @@ -1,22 +1,62 @@ # Projects shown on the landing page (content/_index.md -> {{< projects >}}). # # Fields: -# name display name, required -# url absolute http(s) URL, required -# description one or two sentences for the card, required -# status short badge such as "live", "beta", "in Arbeit", optional -# tags short labels, optional +# name display name, required +# url absolute http(s) URL, required +# description long-form Markdown: the idea plus the technical implementation, +# roughly 1-2 minutes of reading (250-400 words), required +# image image path inside assets/, e.g. projects/foo.jpg, required. +# Hugo resizes it to 800px WebP for the page. +# image_alt short German alt text for the image, strongly recommended +# image_credit small caption under the image, optional +# status short badge such as "live", "beta", "in Arbeit", optional +# tags short labels, optional # # Order here is the order on the page. Add new projects at the top. - name: Berlin Crime Stories url: https://berlin-crime.poweronoff.click - description: >- - Kriminalgeschichten aus Berlin: kurze Krimis an echten Schauplätzen der Stadt, - erzählt von Graf Lisitschka. Die Fälle erscheinen auf Deutsch, Englisch und - Russisch und wachsen mit jeder neuen Folge. status: live tags: - Krimi - Berlin - Storytelling + image: projects/berlin-crime-stories.jpg + image_alt: "Kalle und Leni, die beiden Ermittler des Projekts, in dunklen Jacken mit Polizei-Ausweisen vor einer Berlin-Karte im Präsidium." + image_credit: "Kalle und Leni – Figuren aus dem Projekt" + description: | + **Die Idee.** Berlin Crime Stories ist eine Reihe kurzer Kriminalgeschichten, + die an echten Schauplätzen in Berlin spielen: in Wedding, Neukölln, + Charlottenburg und Köpenick. Jede Folge beginnt an einem konkreten Ort – ein + Juwelier in der Breitenbachstraße, eine Tankstelle in Friedrichshagen, eine + Kreuzung in Schöneberg – und entwickelt daraus einen Fall, der sich in einer + Sitzung lesen lässt. Erzählt wird aus der Perspektive von Kalle und Leni, zwei + Ermittlern, die mehr über kalten Kaffee und müde Füße wissen als über Heroik. + Die Fälle sind erfunden, die Orte nicht: Straßennamen, U-Bahn-Stationen und + Spätis gehören zur Recherche, genauso wie der Geruch von nassem Herbstlaub. + Der Ort ist mehr als Kulisse – die Geschichten funktionieren nur, weil sie in + dieser Stadt spielen, mit ihren Kiezen, ihren Geräuschen und ihren + eigentümlichen Details. Jede Folge steht für sich, wiederkehrende Figuren + verbinden sie zu einer lose erzählten Serie. Die Erzählerfigur Graf + Lisitschka ist dabei ein augenzwinkerndes Pseudonym – ein Sammler von + Geschichten, kein Adliger. Die drei Sprachfassungen sollen denselben Fall + einem größeren Publikum zugänglich machen. Das Ziel ist Unterhaltung in + kleinen Dosen: eine Folge, ein Fall, fünf Minuten. + + **Die Umsetzung.** Technisch ist das Projekt eine statische Hugo-Seite, die + über Hugos Multilingual-Modus auf Deutsch, Englisch und Russisch ausgeliefert + wird. Jede Sprache hat ihre eigene Inhaltsstruktur, gemeinsame Templates + rendern daraus die Seiten. Die Folgen liegen als Markdown-Dateien vor; + Kategorien und Tags – die Bezirke sind als Tags hinterlegt – erzeugen + Übersichtsseiten und RSS-Feeds automatisch, sodass sich die Fälle nach Kiezen + filtern lassen. Das Theme ist eine angepasste Variante eines freien + Hugo-Themes mit eigenem CSS, Font Awesome, Animationen, Lazy-Loading über + lazysizes und einem Teilen-Menü. Zu jeder Geschichte gehört eine eigene + Illustration, die als Vorschaubild und im Artikel erscheint. Neue Folgen sind + am Ende eine Markdown-Datei und ein Build: kein CMS, keine Datenbank, nichts, + das laufend gepflegt werden müsste. Das Kontaktformular kommt ebenfalls ohne + Backend aus: Cloudflare Turnstile prüft, ob ein Mensch schreibt, und ein + kleiner Cloudflare Worker schickt die Nachricht an Telegram. Ausgeliefert + wird die Seite als statisches Verzeichnis über Apache mit strikter + Content-Security-Policy; Cloudflare Web Analytics zählt Zugriffe ohne Cookies. + Kein Tracking, keine Anmeldung, keine Datenbank. diff --git a/layouts/_partials/extend_head.html b/layouts/_partials/extend_head.html index 7430e44..8f7a04f 100644 --- a/layouts/_partials/extend_head.html +++ b/layouts/_partials/extend_head.html @@ -1,5 +1,5 @@ {{- /* Custom head content. Kept minimal on purpose: the only thing we add is - styling for the project cards rendered by layouts/shortcodes/projects.html. + styling for the project entries rendered by layouts/shortcodes/projects.html. PaperMod calls this partial from its own head.html, so no theme fork. */ -}} {{- if .IsHome }} @@ -8,26 +8,34 @@ margin: 2rem 0 1rem; } - .project-grid { + .project { display: grid; - grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); - gap: 1rem; - margin-top: 1.25rem; - } - - .project-card { + grid-template-columns: minmax(0, 340px) minmax(0, 1fr); + gap: 1.5rem; + align-items: start; background: var(--entry); border: 1px solid var(--border); - border-radius: 8px; - padding: 1.3rem 1.4rem; - display: flex; - flex-direction: column; - transition: transform 0.15s ease, border-color 0.15s ease; + border-radius: 10px; + padding: 1.5rem; + margin-bottom: 1.75rem; } - .project-card:hover { - border-color: var(--secondary); - transform: translateY(-2px); + .project-media { + margin: 0; + } + + .project-media img { + display: block; + width: 100%; + height: auto; + border-radius: 6px; + border: 1px solid var(--border); + } + + .project-media figcaption { + margin-top: 0.4rem; + font-size: 0.72rem; + color: var(--secondary); } .project-header { @@ -35,11 +43,12 @@ align-items: baseline; justify-content: space-between; gap: 0.75rem; + margin-bottom: 0.5rem; } .project-header h3 { margin: 0; - font-size: 1.25rem; + font-size: 1.45rem; line-height: 1.3; } @@ -54,10 +63,13 @@ padding: 0.1rem 0.55rem; } - .project-description { - color: var(--secondary); - line-height: 1.65; - margin: 0.75rem 0 1rem; + .project-text p { + margin: 0 0 0.85rem; + line-height: 1.7; + } + + .project-text p:last-child { + margin-bottom: 0; } .project-tags { @@ -65,7 +77,7 @@ flex-wrap: wrap; gap: 0.4rem; list-style: none; - margin: 0 0 1rem; + margin: 1rem 0 0; padding: 0; } @@ -77,9 +89,20 @@ padding: 0.1rem 0.55rem; } + .project-footer { + margin-top: 1rem; + } + .project-link { - margin-top: auto; font-weight: 600; } + + @media (max-width: 720px) { + .project { + grid-template-columns: 1fr; + gap: 1rem; + padding: 1.1rem; + } + } {{- end }} diff --git a/layouts/shortcodes/projects.html b/layouts/shortcodes/projects.html index 0f1e31b..c9ffb39 100644 --- a/layouts/shortcodes/projects.html +++ b/layouts/shortcodes/projects.html @@ -1,26 +1,46 @@ -{{- /* Renders the project cards on the landing page from data/projects.yaml. +{{- /* Renders the project entries on the landing page from data/projects.yaml. Validates the data so a broken entry fails the build instead of shipping - an empty card. Styling lives in layouts/_partials/extend_head.html. */ -}} + an empty card. Images live in assets/ and are resized by Hugo. + Styling lives in layouts/_partials/extend_head.html. */ -}} {{- with hugo.Data.projects -}}

Projekte

-
- {{- range $project := . }} - {{- if or (not $project.name) (not $project.url) (not $project.description) }} - {{- errorf "data/projects.yaml: entry %q needs name, url and description" (default "" $project.name) }} - {{- end }} - {{- if not (hasPrefix $project.url "http") }} - {{- errorf "data/projects.yaml: %q must use an absolute http(s) url, got %q" $project.name $project.url }} - {{- end }} -
+ {{- range $project := . }} + {{- if or (not $project.name) (not $project.url) (not $project.description) (not $project.image) }} + {{- errorf "data/projects.yaml: entry %q needs name, url, description and image" (default "" $project.name) }} + {{- end }} + {{- if not (hasPrefix $project.url "http") }} + {{- errorf "data/projects.yaml: %q must use an absolute http(s) url, got %q" $project.name $project.url }} + {{- end }} + {{- $image := resources.Get $project.image }} + {{- if $image }} + {{- $image = $image.Resize "800x webp" }} + {{- else }} + {{- errorf "data/projects.yaml: image %q for %q does not exist under assets/" $project.image $project.name }} + {{- end }} +
+
+ {{- with $image }} + + {{- end }} + {{- with $project.image_credit }} +
{{ . }}
+ {{- end }} +
+

{{ $project.name }}

{{- with $project.status }} {{ . }} {{- end }}
-

{{ $project.description }}

+
+ {{- $.Page.RenderString (dict "display" "block") $project.description -}} +
{{- with $project.tags }}
    {{- range . }} @@ -28,10 +48,12 @@ {{- end }}
{{- end }} - Projekt ansehen → -
- {{- end }} -
+ + + + {{- end }}
{{- else -}} {{- errorf "data/projects.yaml is missing or empty" -}}