edit image gallery function

This commit is contained in:
2024-04-07 17:17:24 +02:00
parent 3aa5db585f
commit 620f082512
3 changed files with 55 additions and 70 deletions
+13 -15
View File
@@ -3,21 +3,19 @@
<div class="text-xs md:text-sm mb-4">{{ .Date | time.Format ":date_long" }}</div>
<h1 class="text-neutral-600">{{ .Title }}</h1>
{{ .Content }}
{{- partial "post-gallery.html" . -}}
<div class="flex flex-row justify-between mt-8">
<div>
{{ if .PrevPage }}
<a class="underline text-tertiary-600 hover:text-tertiary-500 visited:text-primary-400" href="{{ .PrevPage.Permalink}}">Vorheriger: {{ .PrevPage.Title }}</a>
{{ end }}
</div>
<div>
{{ if .NextPage }}
<a class="underline text-tertiary-600 hover:text-tertiary-500 visited:text-primary-400" href="{{ .NextPage.Permalink}}">Nächster: {{ .NextPage.Title }}</a>
{{ end }}
</div>
</div>
</article>
<div class="flex flex-row justify-between mt-8">
<div>
{{ if .PrevPage }}
<a class="underline text-tertiary-600 hover:text-tertiary-500 visited:text-primary-400" href="{{ .PrevPage.Permalink}}">Vorheriger: {{ .PrevPage.Title }}</a>
{{ end }}
</div>
<div>
{{ if .NextPage }}
<a class="underline text-tertiary-600 hover:text-tertiary-500 visited:text-primary-400" href="{{ .NextPage.Permalink}}">Nächster: {{ .NextPage.Title }}</a>
{{ end }}
</div>
</div>
{{- partial "post-gallery.html" . -}}
{{ end }}
@@ -1,6 +1,9 @@
{{ $image := (.Page.Resources.ByType "image") }}
{{ with $image }}
{{ range . }}
<a href="{{ .Permalink }}" data-lightbox="x"><img src="{{ .Permalink }}" /></a>
{{ end }}
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
{{ range . }}
{{ $resized := .Resize "512x webp q70" }}
<a href="{{ .Permalink }}" data-lightbox="x"><img src="{{ $resized.Permalink }}" /></a>
{{ end }}
</div>
{{ end }}