Blog- und Veranstaltungsbereich hinzugefuegt

Neuer Bereich /blog fuer Veranstaltungstipps und Neuigkeiten aus
Kaufbeuren: content/blog/ (inkl. erstem Beitrag "Veranstaltungen
Herbst 2026" als Page-Bundle mit Bildern), Layouts layouts/blog/
(list + single) und ein bild-Shortcode, der Bilder aus dem Bundle
aufloest und eine Bildquelle anzeigt. Menueintrag "Blog" in hugo.toml,
zugehoeriges Blog-CSS (und Belegungsplan-Band) in style.css.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@
This commit is contained in:
Michael Stangl
2026-08-28 16:45:09 +02:00
parent 2379f4ac9f
commit eeffa578cb
18 changed files with 249 additions and 6 deletions
+33
View File
@@ -0,0 +1,33 @@
{{ define "main" }}
<article class="page">
<div class="container">
<h1>{{ .Title }}</h1>
{{ .Content }}
<div class="fewo-grid blog-grid">
{{ range .Pages.ByPublishDate.Reverse }}
<div class="fewo-card">
{{ $post := . }}
{{ with .Params.bild }}
{{ $src := . }}
{{ with $post.Resources.GetMatch $src }}{{ $src = .RelPermalink }}{{ end }}
<a href="{{ $post.RelPermalink }}" class="fewo-card-imglink">
<img src="{{ $src }}" alt="{{ with $post.Params.bild_alt }}{{ . }}{{ else }}{{ $post.Title }}{{ end }}" class="fewo-card-img" loading="lazy">
</a>
{{ end }}
<div class="fewo-card-body">
<p class="blog-date">{{ .PublishDate.Format "02.01.2006" }}</p>
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ with .Params.description }}<p>{{ . }}</p>{{ end }}
<a href="{{ .RelPermalink }}" class="btn btn-primary">Weiterlesen</a>
</div>
</div>
{{ end }}
</div>
{{ if not .Pages }}
<p>Aktuell sind keine Beiträge veröffentlicht. Schauen Sie bald wieder vorbei!</p>
{{ end }}
</div>
</article>
{{ end }}
+18
View File
@@ -0,0 +1,18 @@
{{ define "main" }}
<article class="page blog-post">
<div class="container container--narrow">
<p class="blog-date">{{ .PublishDate.Format "02.01.2006" }}</p>
<h1>{{ .Title }}</h1>
{{ with .Params.bild }}
{{ $src := . }}
{{ with $.Resources.GetMatch $src }}{{ $src = .RelPermalink }}{{ end }}
<figure class="blog-hero">
<img src="{{ $src }}" alt="{{ with $.Params.bild_alt }}{{ . }}{{ else }}{{ $.Title }}{{ end }}" class="blog-hero-img">
{{ with $.Params.bild_quelle }}<figcaption class="bild-quelle">Bildquelle: {{ . | safeHTML }}</figcaption>{{ end }}
</figure>
{{ end }}
{{ .Content }}
<p class="blog-back"><a href="/blog/" class="btn btn-outline">&larr; Zurück zur Übersicht</a></p>
</div>
</article>
{{ end }}
+11
View File
@@ -0,0 +1,11 @@
{{- $src := .Get "src" -}}
{{- $alt := .Get "alt" -}}
{{- $quelle := .Get "quelle" -}}
{{- /* Bild als Page-Resource aus dem Bundle auflösen; sonst src unverändert nutzen */ -}}
{{- with .Page.Resources.GetMatch $src }}{{ $src = .RelPermalink }}{{ end -}}
<figure class="blog-figure">
<img src="{{ $src }}" alt="{{ $alt }}" loading="lazy">
{{- with $quelle }}
<figcaption class="bild-quelle">Bildquelle: {{ . | safeHTML }}</figcaption>
{{- end }}
</figure>