1
0
forked from BgLUG/bglug.it
bglug.it/layouts/shortcodes/foldergallery.html
paspo 1d827eae76 primo fix foldergallery (#143)
BgLUG/bglug.it#139
Reviewed-on: BgLUG/bglug.it#143
Co-authored-by: paspo <paolo@asperti.com>
Co-committed-by: paspo <paolo@asperti.com>
2024-07-21 22:27:42 +00:00

43 lines
1.3 KiB
HTML

<!-- /layouts/shortcodes/foldergallery.html -->
<style>
div.gallery {
display: flex;
flex-wrap: wrap;
}
div.gallery a {
flex-grow: 1;
object-fit: cover;
margin: 2px;
display: flex;
}
div.gallery a img {
height: 200px;
object-fit: cover;
flex-grow: 1;
}
</style>
<!-- 3.7.1 integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo="-->
<!-- 3.6.0 integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="-->
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery.fancybox.3.5.7.min.js"></script>
<link rel="stylesheet" href="/js/jquery.fancybox.3.5.7.min.css" />
<div class="gallery">
{{- range (.Page.Resources.ByType "image") -}}
{{- $big := .Resize "x1600 webp q85" -}}
{{- $mid := .Resize "x1080 webp q80" -}}
{{- $sml := .Resize "x480 webp q70" -}}
{{- $thumb := .Resize "x200 webp q50" -}}
<a data-fancybox="gallery" data-type="image"
data-caption="{{ .Title }}"
data-srcset="{{ $big.RelPermalink }} {{ $big.Width }}w, {{ $mid.RelPermalink }} {{ $mid.Width }}w, {{ $sml.RelPermalink }} {{ $sml.Width }}w"
href="{{ $big.RelPermalink }}">
<img src="{{ $thumb.RelPermalink }}" alt="">
</a>
{{- end -}}
</div>