Files
hugo-snap-gallery/layouts/partials/gallery.html
Max Mehl 437b0202ba 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>
2024-02-07 22:17:49 +01:00

15 lines
591 B
HTML

{{- $imgs := .imgs -}}
{{- $galno := .galno -}}
<div class="snap-gallery" style="--columns:{{ default 4 .columns }};--min-width:{{ default "200px" .minwidth }};--gap:10px;--cursor:{{ .cursor }};--aspectratio:{{ safeCSS (default "16/10" .aspectratio) }};">
{{- range $i, $img := $imgs }}
<div class="snap-image">
<img
src="{{ relURL $img.src }}"
{{ range $attr, $value := $img.html -}}
{{ safeHTMLAttr $attr }}={{ $value }}
{{ end -}}
onclick="openLightbox({{ $galno }});openLightboxItem({{ $galno }}, {{ add $i 1 }});" />
</div>
{{- end }}
</div>