diff options
Diffstat (limited to 'layouts/shortcodes/gal-img.html')
| -rw-r--r-- | layouts/shortcodes/gal-img.html | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/layouts/shortcodes/gal-img.html b/layouts/shortcodes/gal-img.html index 0693319..ae7d23e 100644 --- a/layouts/shortcodes/gal-img.html +++ b/layouts/shortcodes/gal-img.html @@ -1,7 +1,16 @@ {{- $src := .Get "src" -}} {{- $source := resources.Get $src -}} {{- $alt := .Get "alt" -}} -{{- $icon := $source.Resize "400x webp" -}} -<a class="gallery-item" href="{{ $source.RelPermalink }}" target="_blank"> - <img src="{{ $icon.RelPermalink }}" alt="{{ $alt }}"> -</a> +{{- $caption := .Get "caption" -}} +{{- $location := .Get "location" -}} +{{- $fullsize := $source -}} +{{- $thumb := $source.Resize "400x webp" -}} +<figure class="photo-card" + data-photo-index="{{ .Ordinal }}" + data-src="{{ $fullsize.RelPermalink }}" + data-alt="{{ $alt }}" + data-caption="{{ $caption }}" + data-location="{{ $location }}"> + <img src="{{ $thumb.RelPermalink }}" alt="{{ $alt }}" loading="lazy"> + {{ with $caption }}<figcaption>{{ . }}</figcaption>{{ end }} +</figure> |
