redstrate.com/themes/red/layouts/_default/gallery.html

45 lines
1.5 KiB
HTML
Raw Normal View History

2022-08-02 14:05:56 -04:00
{{ define "main" }}
<h2>{{ .Title }}</h2>
2022-08-03 13:38:29 -04:00
{{ .Content }}
2022-08-02 14:05:56 -04:00
2022-12-27 21:59:30 -05:00
{{ $selected_year := $.Param "selectedyear" }}
{{ $art := (index site.Data ($.Param "json")) }}
2022-12-27 21:47:12 -05:00
2022-12-28 11:09:13 -05:00
<div class="grid">
2022-12-27 21:59:30 -05:00
{{ range $art.categories }}
{{ $should_include := false }}
2022-12-20 19:16:53 -05:00
2022-12-27 21:59:30 -05:00
{{ range sort .years "year" "desc" }}
{{ if eq (int .year) (int $selected_year) }}
{{ $should_include = true }}
2022-12-27 21:47:12 -05:00
{{ end }}
2022-12-27 21:59:30 -05:00
{{ end }}
2022-12-20 19:16:53 -05:00
2022-12-27 21:59:30 -05:00
{{ if $should_include }}
{{ $without_space := replaceRE "(\\s)" "" .name }}
{{ range sort .years "year" "desc" }}
{{ if eq (int .year) (int $selected_year) }}
{{ $year := .year }}
2022-12-20 19:16:53 -05:00
2022-12-27 21:59:30 -05:00
{{ range .pieces }}
{{ $filename_without_ext := strings.TrimSuffix (path.Ext .filename) .filename }}
2022-12-20 19:16:53 -05:00
2022-12-28 10:24:59 -05:00
{{ $path := printf "/art/%s" $filename_without_ext}}
{{ with $.Site.GetPage $path }}
{{ partial "render-art" . }}
2022-12-27 21:59:30 -05:00
{{ end }}
{{ end }}
2022-12-20 19:16:53 -05:00
{{ end }}
{{ end }}
2022-08-02 14:05:56 -04:00
{{ end }}
{{ end }}
2022-12-28 11:09:13 -05:00
</div>
2022-12-28 10:24:59 -05:00
{{ $site := resources.Get "js/site.js" }}
{{ if hugo.IsProduction }}
{{ $site = $site | minify | fingerprint | resources.PostProcess }}
{{ end }}
<script src="{{ $site.RelPermalink }}" integrity="{{ $site.Data.Integrity }}"></script>
2022-08-02 14:05:56 -04:00
{{ end }}