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
+158 -59

No files matched your search

+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 }}
+38 -16
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) }}
{{- 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">
{{- 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 "<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 }}
{{- $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 }}
<a class="project-link" href="{{ $project.url }}">Projekt ansehen&nbsp;→</a>
</article>
{{- end }}
</div>
<footer class="project-footer">
<a class="project-link" href="{{ $project.url }}">Projekt ansehen&nbsp;→</a>
</footer>
</div>
</article>
{{- end }}
</section>
{{- else -}}
{{- errorf "data/projects.yaml is missing or empty" -}}