diff options
author | Oscar Najera <hi@oscarnajera.com> | 2023-10-19 04:08:37 +0200 |
---|---|---|
committer | Oscar Najera <hi@oscarnajera.com> | 2023-10-19 15:15:45 +0200 |
commit | 2a1b0bf3e757812f230dc769426b804389c797e0 (patch) | |
tree | d5559033320d2c7172596ff31be3a6222ccd3d12 /layouts | |
parent | 61b0a3b49513b95d90fa9201f625e744a5d3fc27 (diff) | |
download | hugo-minimalist-theme-2a1b0bf3e757812f230dc769426b804389c797e0.tar.gz hugo-minimalist-theme-2a1b0bf3e757812f230dc769426b804389c797e0.tar.bz2 hugo-minimalist-theme-2a1b0bf3e757812f230dc769426b804389c797e0.zip |
Image gallery
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/partials/image-gallery.html | 25 |
2 files changed, 27 insertions, 0 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 1f3156a..076e4e7 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -49,6 +49,8 @@ <div class="main-content mw7 center lh-copy f5 f4-ns ph1"> {{ .Content }} </div> + {{ partial "image-gallery" . }} + {{ if .Site.Params.tipping }} {{ partial "tipping" . }} {{ end }} diff --git a/layouts/partials/image-gallery.html b/layouts/partials/image-gallery.html new file mode 100644 index 0000000..5e5b874 --- /dev/null +++ b/layouts/partials/image-gallery.html @@ -0,0 +1,25 @@ +{{ with .Params.album }} + <section class="gallery"> + {{ range $id, $val := readDir (printf "/assets/media/albums/%s" (string .)) }} + {{ with resources.Get (printf "media/albums/%s/%s" $.Params.album $val.Name) }} + <div class="gallery__item"> + <input + type="radio" + id="img-{{ $id }}" + checked + name="gallery" + class="gallery__selector" + /> + <img + class="gallery__img" + src="{{ (.Fill "1152x768").Permalink }}" + alt="" + /> + <label for="img-{{ $id }}" class="gallery__thumb"> + <img src="{{ (.Fill "150x100").Permalink }}" alt="" /> + </label> + </div> + {{ end }} + {{ end }} + </section> +{{ end }} |