Add generic code to build album of all images

This commit is contained in:
2024-10-24 12:00:02 +02:00
parent a5067c7e84
commit fef60c6e43
9 changed files with 118 additions and 17 deletions

32
layouts/albums/list.html Normal file
View File

@@ -0,0 +1,32 @@
{{ define "main" }}
<h2>{{ .Title }}</h2>
{{ partial "albums/breadcrumbs.html" . }}
{{ .Content }}
<div class="subalbums">
{{ range .Pages.GroupBy "Weight" }}
{{ range .Pages.ByTitle }}
<a href="{{ .RelPermalink }}" class="subalbum">
<div class="teaser">
{{ $sa := . }}
{{ with .Params.teaserImage }}
{{ $img := $sa.Resources.Get . }}
<img src="{{ ($img.Fit "300x200 webm").RelPermalink }}" alt="{{ $sa.Title }}">
{{ else }}
{{ warnf "Could not find teaser image for %s" .RelPermalink }}
<img src="{{ (resources.Get "img/no-image.png").RelPermalink }}">
{{ end }}
</div>
<div class="title">{{ .Title }}</div>
</a>
{{ end }}
{{ end }}
</div>
<div class="images">
{{ with .Resources.Get "album.zip" }}
<div class="download">
<a href="{{ .RelPermalink }}" class="button" download="{{ $.Title }}">Ganzes Album herunter laden</a>
</div>
{{ end }}
<div id="gallery"></div>
</div>
{{ end }}