make appearance of lightbox configurable

This commit is contained in:
2024-02-05 14:04:31 +01:00
parent dc64b7bda1
commit 0a778ee8e9
6 changed files with 23 additions and 9 deletions

View File

@@ -30,14 +30,19 @@
{{ end }}
{{ end }}
{{/* Define cursor when hovering over images, depending on lightbox status */}}
{{ $lightbox := (default true .Params.lightbox) }}
{{ $cursor := "auto" }}
{{ if $lightbox }}{{ $cursor = "zoom-in" }}{{ end }}
{{/* Visible images in separate modes */}}
{{ $mode := default "gallery" .Params.mode }}
{{/* Gallery mode */}}
{{ if eq $mode "gallery" }}
{{ partial "gallery" (dict "columns" .Params.columns "minwidth" .Params.minwidth "imgs" $imgs "galno" $galno) }}
{{ partial "gallery" (dict "columns" .Params.columns "minwidth" .Params.minwidth "imgs" $imgs "galno" $galno "cursor" $cursor) }}
{{/* Slideshow mode */}}
{{ else if eq $mode "slideshow" }}
{{ partial "slideshow" (dict "imgs" $imgs "galno" $galno "width" .Params.slideshowwidth) }}
{{ partial "slideshow" (dict "imgs" $imgs "galno" $galno "width" .Params.slideshowwidth "cursor" $cursor) }}
{{/* Set autorotate timer for slideshow, if configured (default: yes) */}}
{{ if .Params.slideshowrotate }}
<script>const autoSlideshow = setInterval(moveSlideshowItem, {{ default 5000 .Params.slideshowrotate_timer }}, {{ $galno }}, 1, "auto");</script>
@@ -45,4 +50,6 @@
{{ end }}
{{/* The Modal/Lightbox */}}
{{ if $lightbox }}
{{ partial "lightbox" (dict "galno" $galno "imgs" $imgs) }}
{{ end }}