diff options
author | Nelson/Roberto <nr@coto.studio> | 2022-02-07 23:42:30 +0300 |
---|---|---|
committer | Nelson/Roberto <nr@coto.studio> | 2022-02-07 23:42:30 +0300 |
commit | 96e33ace05affcb3376bdb5a7eed36d63451d0b2 (patch) | |
tree | 21e01e21ddeec0fcb2c043c04f4b04b4e9284421 | |
parent | 16424be492a6096b2b995ddeeaf180da0b8f518f (diff) |
Gallery now works with .Page.Params and Page Bundles
-rw-r--r-- | layouts/shortcodes/gallery.html | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/layouts/shortcodes/gallery.html b/layouts/shortcodes/gallery.html index 4ac7e69..507178c 100644 --- a/layouts/shortcodes/gallery.html +++ b/layouts/shortcodes/gallery.html @@ -1,7 +1,19 @@ -<div class="box alt"> - <div class="row gtr-50 gtr-uniform"> - {{ range $.Page.Resources.ByType "image" }} - <div class="col-4"><span class="image fit"><img src="{{ .Permalink }}" alt="" /></span></div> - {{ end }} +{{ $scratch := newScratch }} +{{range $.Page.Resources.ByType "image" }} + {{ $scratch.Add "images" (slice .Permalink) }} +{{ else }} + {{ $scratch.Add "images" ($.Page.Param (.Get "name")) }} +{{ end }} + +{{ with $scratch.Get "images" }} + <div class="box alt"> + <div class="row gtr-50 gtr-uniform"> + {{ range . }} + <div class="col-4"> + <span class="image fit"> + <img src="{{ . }}" alt="" /></span> + </div> + {{ end }} + </div> </div> -</div>
\ No newline at end of file +{{ end }}
\ No newline at end of file |