Complete rewrite (#1)
A complete rewrite of the gallery plugin: * Using flexbox * Using lightweight JS for lightbox to avoid anchor links, and allow full rotation * Add slideshow as an additional field * Make many more things configurable * Better support for dirs, allow mixed paths * Translatable captions for many files using metadata files * SCSS instead of CSS Reviewed-on: #1 Co-authored-by: Max Mehl <mail@mehl.mx> Co-committed-by: Max Mehl <mail@mehl.mx>
This commit was merged in pull request #1.
This commit is contained in:
21
layouts/partials/slideshow.html
Normal file
21
layouts/partials/slideshow.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{{- $imgs := .imgs -}}
|
||||
{{- $galno := .galno -}}
|
||||
<div class="snap-slideshow" id="snap-slideshow-{{ $galno }}" style="--columns:1;--min-width:0px;--gap:0px;--slideshow-width:{{ default "100%" .width }};--cursor:{{ .cursor }};--aspectratio:{{ safeCSS (default "16/10" .aspectratio) }};">
|
||||
{{- range $i, $img := $imgs }}
|
||||
<div class="snap-image">
|
||||
<div class="snap-numbertext">{{ add $i 1 }} / {{ len $imgs }}</div>
|
||||
{{- with $img.html.title }}
|
||||
<div class="snap-caption">{{ . }}</div>
|
||||
{{- end }}
|
||||
<img
|
||||
src="{{ relURL $img.src }}"
|
||||
{{ range $attr, $value := $img.html -}}
|
||||
{{ safeHTMLAttr $attr }}={{ $value }}
|
||||
{{ end -}}
|
||||
onclick="openLightbox({{ $galno }});openLightboxItem({{ $galno }}, {{ add $i 1 }});" />
|
||||
</div>
|
||||
{{- end }}
|
||||
|
||||
<a class="snap-prev" onclick="moveSlideshowItem({{ $galno }}, -1)"><span>❮</span></a>
|
||||
<a class="snap-next" onclick="moveSlideshowItem({{ $galno }}, 1)"><span>❯</span></a>
|
||||
</div>
|
||||
Reference in New Issue
Block a user