Give project entries an image and a full description
Build and deploy the poweronoff.click hugo / build (push) Successful in 46s

Each project on the landing page is now a two-column entry: an image from the
project on the left, a long description on the right (stacked on mobile).

- data/projects.yaml: new required `image` (path in assets/), optional
  `image_alt`/`image_credit`, and `description` is now Markdown covering the
  idea and the technical implementation (~350 words, 1.5-2 min)
- assets/projects/berlin-crime-stories.jpg: the project's Kalle-und-Leni
  illustration, resized to 1100 px in the repo and processed by Hugo into an
  800 px WebP (36 KB) at build time
- shortcode renders the description with Page.RenderString (paragraphs, bold),
  resizes the image, and fails the build when name/url/description/image is
  missing or the asset does not exist (no nil-pointer panic)
- extend_head.html: new entry layout using PaperMod variables, responsive below
  720 px
- make check asserts an entry with image is rendered and the text covers both
  "Die Idee" and "Die Umsetzung"; AGENTS.md/README document the new fields

Berlin Crime Stories description covers the series concept, Kalle & Leni, the
Berlin locations, the DE/EN/RU multilingual setup, Hugo templates, tags/RSS,
theme, Turnstile + Cloudflare Worker contact form, Apache + CSP and cookieless
analytics.
This commit is contained in:
morpheus committed 2026-11-07 08:04:31 +01:00
1 parent 9f71737703
commit b094ec91f3
7 files changed
+146 -47

No files matched your search

+16 -7
View File
@@ -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.
+6 -2
View File
@@ -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' \
+3 -2
View File
@@ -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.
Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

+45 -5
View File
@@ -3,7 +3,12 @@
# Fields:
# name display name, required
# url absolute http(s) URL, required
# description one or two sentences for the card, 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
#
@@ -11,12 +16,47 @@
- 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.
+46 -23
View File
@@ -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;
}
}
</style>
{{- end }}
+30 -8
View File
@@ -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 -}}
<section id="projekte" class="projects">
<h2>Projekte</h2>
<div class="project-grid">
{{- 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 "<unnamed>" $project.name) }}
{{- 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 "<unnamed>" $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 }}
<article class="project-card">
{{- $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 }}
<article class="project">
<figure class="project-media">
{{- with $image }}
<a href="{{ $project.url }}" tabindex="-1" aria-hidden="true">
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}"
alt="{{ $project.image_alt | default $project.name }}" loading="lazy" decoding="async">
</a>
{{- end }}
{{- with $project.image_credit }}
<figcaption>{{ . }}</figcaption>
{{- end }}
</figure>
<div class="project-body">
<header class="project-header">
<h3><a href="{{ $project.url }}">{{ $project.name }}</a></h3>
{{- with $project.status }}
<span class="project-status">{{ . }}</span>
{{- end }}
</header>
<p class="project-description">{{ $project.description }}</p>
<div class="project-text">
{{- $.Page.RenderString (dict "display" "block") $project.description -}}
</div>
{{- with $project.tags }}
<ul class="project-tags">
{{- range . }}
@@ -28,10 +48,12 @@
{{- end }}
</ul>
{{- end }}
<footer class="project-footer">
<a class="project-link" href="{{ $project.url }}">Projekt ansehen&nbsp;→</a>
</footer>
</div>
</article>
{{- end }}
</div>
</section>
{{- else -}}
{{- errorf "data/projects.yaml is missing or empty" -}}