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.
61 lines
2.6 KiB
HTML
61 lines
2.6 KiB
HTML
{{- /* 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. 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>
|
|
{{- 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>
|
|
<div class="project-text">
|
|
{{- $.Page.RenderString (dict "display" "block") $project.description -}}
|
|
</div>
|
|
{{- with $project.tags }}
|
|
<ul class="project-tags">
|
|
{{- range . }}
|
|
<li>{{ . }}</li>
|
|
{{- end }}
|
|
</ul>
|
|
{{- end }}
|
|
<footer class="project-footer">
|
|
<a class="project-link" href="{{ $project.url }}">Projekt ansehen →</a>
|
|
</footer>
|
|
</div>
|
|
</article>
|
|
{{- end }}
|
|
</section>
|
|
{{- else -}}
|
|
{{- errorf "data/projects.yaml is missing or empty" -}}
|
|
{{- end -}}
|