arbejdsfaellesskab.dk/hugo_site/layouts/shortcodes/foldergallery.html

35 lines
763 B
HTML
Raw Permalink Normal View History

2019-05-16 16:06:22 +00:00
<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>
<div class="gallery">
{{ $path := print "static/" (.Page.Dir) (.Get "src") }}
2019-05-16 16:06:22 +00:00
{{ $url := print .Site.BaseURL (.Get "src") }}
{{ range shuffle (.Page.Resources.ByType "image") }}
{{ if in .Name "." }}
{{ $thumb := .Fit "640x640" }}
<a href="{{ .RelPermalink }}" target="_blank">
<img src="{{ $thumb.RelPermalink }}"> <br/>
</a>
{{ end }}
{{ end }}
</div>