Give project entries an image and a full description
Build and deploy the poweronoff.click hugo / build (push) Successful in 46s
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:
1 parent
9f71737703
commit
b094ec91f3
7 files changed
+146
-47
No files matched your search
@@ -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 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 /
|
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
|
Datenschutz pages are missing, if placeholder text or a dev base URL leaks into
|
||||||
`public/`, or if an internal link does not resolve.
|
`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 |
|
| `config.yml` | Site config: title, language, params, footer text, analytics |
|
||||||
| `content/_index.md` | Landing page copy (intro, `{{< projects >}}`, contact) |
|
| `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/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/about.md` | "Über mich" page, must stay (menu + landing page link to it) |
|
||||||
| `content/impressum.md`, `content/data_protection.md` | Legal pages, must stay |
|
| `content/impressum.md`, `content/data_protection.md` | Legal pages, must stay |
|
||||||
| `layouts/shortcodes/obfuscate.html` | Base64 email obfuscation shortcode |
|
| `layouts/shortcodes/obfuscate.html` | Base64 email obfuscation shortcode |
|
||||||
@@ -62,14 +64,21 @@ Edit `data/projects.yaml`. Fields:
|
|||||||
|
|
||||||
- `name` — display name, required
|
- `name` — display name, required
|
||||||
- `url` — absolute `https://` URL, 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)
|
- `status` — short badge, e.g. `live`, `beta`, `in Arbeit` (optional)
|
||||||
- `tags` — short labels (optional)
|
- `tags` — short labels (optional)
|
||||||
|
|
||||||
Put new projects at the top. The shortcode calls `errorf` when a required field
|
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
|
is missing, the URL is not absolute, or the image does not exist under `assets/`,
|
||||||
of shipping an empty card. Do not create per-project Hugo pages — the card links
|
so a broken entry fails the build instead of shipping a half-empty entry.
|
||||||
out to the project's own site. Card styling lives in
|
`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
|
`layouts/_partials/extend_head.html`; keep using PaperMod CSS variables
|
||||||
(`--entry`, `--border`, `--secondary`, ...) so light/dark mode keeps working.
|
(`--entry`, `--border`, `--secondary`, ...) so light/dark mode keeps working.
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,12 @@ check: build ## Build, then verify the generated site
|
|||||||
@test -f public/about/index.html
|
@test -f public/about/index.html
|
||||||
@test -f public/impressum/index.html
|
@test -f public/impressum/index.html
|
||||||
@test -f public/data_protection/index.html
|
@test -f public/data_protection/index.html
|
||||||
@grep -q 'project-card' public/index.html \
|
@grep -q 'class=project' public/index.html \
|
||||||
|| { echo "FAIL: no project cards rendered (data/projects.yaml?)"; exit 1; }
|
|| { 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 \
|
@grep -q 'berlin-crime.poweronoff.click' public/index.html \
|
||||||
|| { echo "FAIL: Berlin Crime Stories missing from the landing page"; exit 1; }
|
|| { 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' \
|
@! grep -rl "Lorem Ipsum\|dolor sit amet\|TODO: body\.\|TODO: intro paragraph" public --include='*.html' \
|
||||||
|
|||||||
@@ -17,5 +17,6 @@ make serve # preview on http://localhost:1313
|
|||||||
make check # build + project/content/link checks
|
make check # build + project/content/link checks
|
||||||
```
|
```
|
||||||
|
|
||||||
Add a project by appending an entry to `data/projects.yaml` and running
|
Add a project by appending an entry to `data/projects.yaml` (name, URL, a
|
||||||
`make check`. See [AGENTS.md](AGENTS.md) for conventions and guardrails.
|
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
@@ -3,7 +3,12 @@
|
|||||||
# Fields:
|
# Fields:
|
||||||
# name display name, required
|
# name display name, required
|
||||||
# url absolute http(s) URL, 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
|
# status short badge such as "live", "beta", "in Arbeit", optional
|
||||||
# tags short labels, optional
|
# tags short labels, optional
|
||||||
#
|
#
|
||||||
@@ -11,12 +16,47 @@
|
|||||||
|
|
||||||
- name: Berlin Crime Stories
|
- name: Berlin Crime Stories
|
||||||
url: https://berlin-crime.poweronoff.click
|
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
|
status: live
|
||||||
tags:
|
tags:
|
||||||
- Krimi
|
- Krimi
|
||||||
- Berlin
|
- Berlin
|
||||||
- Storytelling
|
- 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.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{{- /* Custom head content. Kept minimal on purpose: the only thing we add is
|
{{- /* 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. */ -}}
|
PaperMod calls this partial from its own head.html, so no theme fork. */ -}}
|
||||||
|
|
||||||
{{- if .IsHome }}
|
{{- if .IsHome }}
|
||||||
@@ -8,26 +8,34 @@
|
|||||||
margin: 2rem 0 1rem;
|
margin: 2rem 0 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-grid {
|
.project {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
|
||||||
gap: 1rem;
|
gap: 1.5rem;
|
||||||
margin-top: 1.25rem;
|
align-items: start;
|
||||||
}
|
|
||||||
|
|
||||||
.project-card {
|
|
||||||
background: var(--entry);
|
background: var(--entry);
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-radius: 8px;
|
border-radius: 10px;
|
||||||
padding: 1.3rem 1.4rem;
|
padding: 1.5rem;
|
||||||
display: flex;
|
margin-bottom: 1.75rem;
|
||||||
flex-direction: column;
|
|
||||||
transition: transform 0.15s ease, border-color 0.15s ease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-card:hover {
|
.project-media {
|
||||||
border-color: var(--secondary);
|
margin: 0;
|
||||||
transform: translateY(-2px);
|
}
|
||||||
|
|
||||||
|
.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 {
|
.project-header {
|
||||||
@@ -35,11 +43,12 @@
|
|||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-header h3 {
|
.project-header h3 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 1.25rem;
|
font-size: 1.45rem;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,10 +63,13 @@
|
|||||||
padding: 0.1rem 0.55rem;
|
padding: 0.1rem 0.55rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-description {
|
.project-text p {
|
||||||
color: var(--secondary);
|
margin: 0 0 0.85rem;
|
||||||
line-height: 1.65;
|
line-height: 1.7;
|
||||||
margin: 0.75rem 0 1rem;
|
}
|
||||||
|
|
||||||
|
.project-text p:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-tags {
|
.project-tags {
|
||||||
@@ -65,7 +77,7 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 0.4rem;
|
gap: 0.4rem;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0 0 1rem;
|
margin: 1rem 0 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,9 +89,20 @@
|
|||||||
padding: 0.1rem 0.55rem;
|
padding: 0.1rem 0.55rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.project-footer {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.project-link {
|
.project-link {
|
||||||
margin-top: auto;
|
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 720px) {
|
||||||
|
.project {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
gap: 1rem;
|
||||||
|
padding: 1.1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -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
|
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 -}}
|
{{- with hugo.Data.projects -}}
|
||||||
<section id="projekte" class="projects">
|
<section id="projekte" class="projects">
|
||||||
<h2>Projekte</h2>
|
<h2>Projekte</h2>
|
||||||
<div class="project-grid">
|
|
||||||
{{- range $project := . }}
|
{{- range $project := . }}
|
||||||
{{- if or (not $project.name) (not $project.url) (not $project.description) }}
|
{{- if or (not $project.name) (not $project.url) (not $project.description) (not $project.image) }}
|
||||||
{{- errorf "data/projects.yaml: entry %q needs name, url and description" (default "<unnamed>" $project.name) }}
|
{{- errorf "data/projects.yaml: entry %q needs name, url, description and image" (default "<unnamed>" $project.name) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if not (hasPrefix $project.url "http") }}
|
{{- if not (hasPrefix $project.url "http") }}
|
||||||
{{- errorf "data/projects.yaml: %q must use an absolute http(s) url, got %q" $project.name $project.url }}
|
{{- errorf "data/projects.yaml: %q must use an absolute http(s) url, got %q" $project.name $project.url }}
|
||||||
{{- end }}
|
{{- 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">
|
<header class="project-header">
|
||||||
<h3><a href="{{ $project.url }}">{{ $project.name }}</a></h3>
|
<h3><a href="{{ $project.url }}">{{ $project.name }}</a></h3>
|
||||||
{{- with $project.status }}
|
{{- with $project.status }}
|
||||||
<span class="project-status">{{ . }}</span>
|
<span class="project-status">{{ . }}</span>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</header>
|
</header>
|
||||||
<p class="project-description">{{ $project.description }}</p>
|
<div class="project-text">
|
||||||
|
{{- $.Page.RenderString (dict "display" "block") $project.description -}}
|
||||||
|
</div>
|
||||||
{{- with $project.tags }}
|
{{- with $project.tags }}
|
||||||
<ul class="project-tags">
|
<ul class="project-tags">
|
||||||
{{- range . }}
|
{{- range . }}
|
||||||
@@ -28,10 +48,12 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
<footer class="project-footer">
|
||||||
<a class="project-link" href="{{ $project.url }}">Projekt ansehen →</a>
|
<a class="project-link" href="{{ $project.url }}">Projekt ansehen →</a>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
</article>
|
</article>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- errorf "data/projects.yaml is missing or empty" -}}
|
{{- errorf "data/projects.yaml is missing or empty" -}}
|
||||||
|
|||||||
Reference in new issue
Block a user