-
{{ .kind }}, {{ .year }}
-
{{ .title }}
- {{ with .text }}
{{ . }}
{{ end }}
+{{ with $featured }}
+
+
+
+
+ {{ partial "img.html" (dict "res" .cover "alt" (printf "Cover von %s" .title) "sizes" "(min-width: 900px) 30rem, 80vw" "widths" (slice 480 800) "eager" true) }}
+
+
+
+
{{ .kind }}, erschienen am {{ .date | time.Format "2. January 2006" }}
+
{{ .title }}
+ {{ with $.Params.albumText }}
{{ . }}
{{ end }}
Auf Spotify hören
- {{ end }}
-
- {{ partial "spotify.html" . }}
-
+{{ end }}
-{{ with .Params.singles }}
-
- Singles
-
+{{ $rest := slice }}
+{{ range $releases }}{{ if or (not $featured) (ne .key $featured.key) }}{{ $rest = $rest | append . }}{{ end }}{{ end }}
+{{ with $rest }}
+
+ Diskografie
+
{{ range . }}
- -
- {{ .title }}
- {{ with .year }}{{ . }}{{ end }}
+
-
+
+ {{ partial "img.html" (dict "res" .cover "alt" (printf "Cover von %s" .title) "sizes" "(min-width: 900px) 22rem, 45vw" "widths" (slice 400 800)) }}
+
+ {{ .title }}
+ {{ .kind }},
{{ end }}
{{ end }}
+
+ Reinhören
+ {{ partial "spotify.html" . }}
+
+
Mehr von uns
diff --git a/layouts/partials/img.html b/layouts/partials/img.html
index 829eb65..d48cecc 100644
--- a/layouts/partials/img.html
+++ b/layouts/partials/img.html
@@ -1,13 +1,15 @@
{{/*
Responsives Bild aus static/img (über assets/img gemountet).
- Parameter: src (z. B. "/img/about/Olly_compressed.jpg"), alt, sizes, widths, class, eager
+ Parameter: src (z. B. "/img/about/Olly_compressed.jpg") oder res (fertige Ressource),
+ alt, sizes, widths, class, eager
*/}}
+{{- $r := .res -}}
{{- $src := .src -}}
+{{- if $r }}{{ $src = $r.Name }}{{ else }}{{ $r = resources.Get (strings.TrimPrefix "/" $src) }}{{ end -}}
{{- $alt := .alt | default "" -}}
{{- $sizes := .sizes | default "100vw" -}}
{{- $widths := .widths | default (slice 480 960 1600) -}}
{{- $loading := cond (.eager | default false) "eager" "lazy" -}}
-{{- $r := resources.Get (strings.TrimPrefix "/" $src) -}}
{{- if and $r (in (slice ".jpg" ".jpeg" ".png") (lower (path.Ext $src))) -}}
{{- $set := slice -}}
{{- $fallback := "" -}}
diff --git a/layouts/partials/releases.html b/layouts/partials/releases.html
new file mode 100644
index 0000000..ebb70cd
--- /dev/null
+++ b/layouts/partials/releases.html
@@ -0,0 +1,19 @@
+{{/*
+ Liest alle Cover aus releases/ (gemountet nach assets/img/releases) und
+ gibt sie neueste zuerst zurück. Dateiname: 20250718_Album_OceanTales.jpg
+*/}}
+{{- $releases := slice -}}
+{{- range resources.Match "img/releases/*" -}}
+ {{- $file := path.Base .Name -}}
+ {{- $base := strings.TrimSuffix (path.Ext $file) $file -}}
+ {{- $parts := split $base "_" -}}
+ {{- if ge (len $parts) 3 -}}
+ {{- $d := index $parts 0 -}}
+ {{- $title := delimit (after 2 $parts) " " -}}
+ {{- $title = replaceRE "([a-z])([A-Z])" "$1 $2" $title -}}
+ {{- $title = replace $title "'" "’" -}}
+ {{- $date := time.AsTime (printf "%s-%s-%s" (substr $d 0 4) (substr $d 4 2) (substr $d 6 2)) -}}
+ {{- $releases = $releases | append (dict "key" $d "date" $date "kind" (index $parts 1) "title" $title "cover" .) -}}
+ {{- end -}}
+{{- end -}}
+{{- return sort $releases "key" "desc" -}}