This commit is contained in:
1 parent
09a4754d51
commit
44866d1b87
6 files changed
+118
-64
No files matched your search
+35
-17
@@ -1,37 +1,55 @@
|
||||
{{ define "main" }}
|
||||
{{ $releases := partial "releases.html" . }}
|
||||
{{/* Hervorgehoben wird das neueste Album, ohne Album das neueste Release. */}}
|
||||
{{ $featured := false }}
|
||||
{{ with where $releases "kind" "Album" }}{{ $featured = index . 0 }}{{ else }}{{ with $releases }}{{ $featured = index . 0 }}{{ end }}{{ end }}
|
||||
|
||||
<header class="page-head wrap">
|
||||
<h1 class="display display--xl">{{ .Title }}</h1>
|
||||
{{ with .Content }}<div class="page-head__lead">{{ . }}</div>{{ end }}
|
||||
</header>
|
||||
|
||||
<section class="wrap release">
|
||||
{{ with .Params.album }}
|
||||
<div class="release__album">
|
||||
<p class="release__kind">{{ .kind }}, {{ .year }}</p>
|
||||
<h2 class="release__title">{{ .title }}</h2>
|
||||
{{ with .text }}<p class="release__text">{{ . }}</p>{{ end }}
|
||||
{{ with $featured }}
|
||||
<section class="wrap album" aria-labelledby="album-title">
|
||||
<div class="album__sleeve">
|
||||
<div class="album__vinyl" aria-hidden="true"></div>
|
||||
<div class="album__cover">
|
||||
{{ partial "img.html" (dict "res" .cover "alt" (printf "Cover von %s" .title) "sizes" "(min-width: 900px) 30rem, 80vw" "widths" (slice 480 800) "eager" true) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="album__info">
|
||||
<p class="album__kind">{{ .kind }}, erschienen am {{ .date | time.Format "2. January 2006" }}</p>
|
||||
<h2 id="album-title" class="album__title">{{ .title }}</h2>
|
||||
{{ with $.Params.albumText }}<p class="album__text">{{ . }}</p>{{ end }}
|
||||
<a class="button button--bolt" href="{{ site.Params.spotify }}" target="_blank" rel="noopener">Auf Spotify hören</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="release__player">
|
||||
{{ partial "spotify.html" . }}
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.singles }}
|
||||
<section class="wrap singles" aria-labelledby="singles">
|
||||
<h2 id="singles" class="display">Singles</h2>
|
||||
<ol class="tracklist">
|
||||
{{ $rest := slice }}
|
||||
{{ range $releases }}{{ if or (not $featured) (ne .key $featured.key) }}{{ $rest = $rest | append . }}{{ end }}{{ end }}
|
||||
{{ with $rest }}
|
||||
<section class="wrap discography" aria-labelledby="diskografie">
|
||||
<h2 id="diskografie" class="display">Diskografie</h2>
|
||||
<ol class="covers">
|
||||
{{ range . }}
|
||||
<li>
|
||||
<span class="tracklist__title">{{ .title }}</span>
|
||||
{{ with .year }}<span class="tracklist__year">{{ . }}</span>{{ end }}
|
||||
<li class="cover">
|
||||
<div class="cover__img">
|
||||
{{ partial "img.html" (dict "res" .cover "alt" (printf "Cover von %s" .title) "sizes" "(min-width: 900px) 22rem, 45vw" "widths" (slice 400 800)) }}
|
||||
</div>
|
||||
<h3 class="cover__title">{{ .title }}</h3>
|
||||
<p class="cover__meta">{{ .kind }}, <time datetime="{{ .date.Format "2006-01-02" }}">{{ .date | time.Format "2. January 2006" }}</time></p>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ol>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
<section class="wrap listen" aria-labelledby="reinhoeren">
|
||||
<h2 id="reinhoeren" class="display">Reinhören</h2>
|
||||
{{ partial "spotify.html" . }}
|
||||
</section>
|
||||
|
||||
<section class="wrap elsewhere" aria-labelledby="elsewhere">
|
||||
<h2 id="elsewhere" class="display">Mehr von uns</h2>
|
||||
<ul class="elsewhere__list">
|
||||
|
||||
@@ -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 := "" -}}
|
||||
|
||||
@@ -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" -}}
|
||||
Reference in new issue
Block a user