shared-bulma-theme/layouts/screenshots/single.html

30 lines
1 KiB
HTML
Raw Normal View History

2018-07-09 11:13:17 +00:00
{{ define "main" }}
<section class="section baguetteBox">
2018-07-09 11:13:17 +00:00
<h1 class="title">{{ .Title }}</h1>
{{ .Content }}
<div class="tile is-ancestor">
{{ $columns := 3 }}
{{ $files := readDir "/static/images/screenshots/" }}
2019-01-08 04:16:19 +00:00
{{ range $index, $element := $files }}
{{ $fileTitle := (index (split .Name "-") 1) }}
{{ $fileTitle := (index (split $fileTitle ".") 0) }}
2018-07-09 11:13:17 +00:00
<div class="tile is-parent">
<div class="tile is-child is-boxed">
<a href="/images/screenshots/{{ .Name }}" title="{{ $fileTitle }}">
{{ $screenshot := resources.Get (printf "/images/screenshots/%s" .Name) }}
{{ $thumb := $screenshot.Fit "640x360 jpg" }}
<img src="{{ $thumb.Permalink }}" alt="{{ $fileTitle }}">
2018-07-09 11:13:17 +00:00
</a>
</div>
</div>
{{if eq (mod $index $columns) (sub $columns 1)}}
2018-07-09 11:13:17 +00:00
</div>
<div class="tile is-ancestor">
{{ end }}
{{ end }}
2018-07-09 11:13:17 +00:00
</div>
</section>
2019-01-08 04:16:19 +00:00
{{ end }}