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

View File

@@ -0,0 +1,8 @@
{{ with .Ancestors }}
<div class="breadcrumbs">
Sie sind hier: {{ range .Reverse }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a> /
{{ end }}
{{ $.Title}}
</div>
{{ end }}

View File

@@ -1,12 +1,24 @@
{{- $first := true -}}
{{- $filter := images.AutoOrient -}}
{{- $teaser := "" -}}
{{- with .Params.teaserImage -}}
{{- $teaser = $.Resources.GetMatch . -}}
{{- end -}}
{{- range .Resources.ByType "image" -}}
{{- if not $first }}, {{ end }}
{{ $first = false -}}
{
"title": "{{ .Title }}",
"url": "{{ .RelPermalink }}",
"width": "{{ .Width }}",
"height": "{{ .Height }}",
"thumbnail": "{{ (.Fit "200x200").RelPermalink }}"
}
{{- if not (eq $teaser .) -}}
{{- if not $first }}, {{ end }}
{{ $first = false -}}
{{- with . | images.Filter $filter -}}
{
"title": "{{ .Title }}",
"url": "{{ .RelPermalink }}",
"width": "{{ .Width }}",
"height": "{{ .Height }}",
"thumbnail": "{{ (.Fit "300x200").RelPermalink }}"
}
{{- end -}}
{{- else -}}
{{ warnf "Skipping teaser image" }}
{{- end -}}
{{ end -}}

View File

@@ -1 +1,2 @@
<p>Copyright {{ now.Year }}. All rights reserved.</p>
<p><a href="{{ relref .Page "page/imprint" }}">Impressum</a></p>

View File

@@ -1,9 +1,18 @@
{{- with resources.Get "css/main.css" }}
{{- if eq hugo.Environment "development" }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{- else }}
{{- with . | minify | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{- with resources.Get "css/main.scss" }}
{{- $sassOptions := dict "targetPath" "css/style.css" "outputStyle" (cond hugo.IsProduction "compressed" "nested") "enableSourceMap" (not hugo.IsProduction) "transpiler" "dartsass" -}}
{{- with . | css.Sass $sassOptions -}}
{{- if hugo.IsProduction }}
{{- with . | minify | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{- end }}
{{- else }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{- end }}
{{- end }}
{{- end }}
{{ with (resources.Get "css/nanogallery2.min.css" | fingerprint ) }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end}}
{{ with (resources.Get "css/nanogallery2.woff.min.css" | fingerprint ) }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end}}

View File

@@ -10,3 +10,7 @@
{{- end }}
{{- end }}
{{- end }}
<!-- <script src="{{ .Page.Site.BaseURL }}/js/main.js" defer></script> -->
<script src="{{ (resources.Get "js/jquery.min.js").RelPermalink }}"></script>
<script src="{{ (resources.Get "js/jquery.nanogallery2.min.js").RelPermalink }}" defer></script>
<script src="{{ (resources.Get "/js/gallery.js").RelPermalink }}" defer></script>

View File

@@ -1,2 +1 @@
<h1>{{ site.Title }}</h1>
{{ partial "menu.html" (dict "menuID" "main" "page" .) }}
<h1><a href="/">{{site.Title }}</a></h1>