make appearance of lightbox configurable
This commit is contained in:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user