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

47 lines
1.8 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
{{ $art := (index site.Data ($.Param "json")) }}
{{ $pixiv_icon := resources.Get "pixiv.png" }}
{{ $newgrounds_icon := resources.Get "newgrounds.png" }}
2022-08-02 14:05:56 -04:00
2022-08-03 13:38:29 -04:00
{{ range $art.categories }}
2022-08-24 10:31:12 -04:00
<h3>{{ .name }}</h3>
<p>{{ .description }}</p>
2022-08-03 13:38:29 -04:00
{{ range sort .years "year" "desc" }}
2022-08-24 10:31:12 -04:00
<h4>{{ .year }}</h4>
2022-08-03 13:38:29 -04:00
{{ range .pieces }}
2022-08-22 17:04:33 -04:00
<figure>
{{ $full := resources.Get (printf "%s/%s" ($.Param "json") .filename) }}
2022-08-02 14:05:56 -04:00
2022-08-24 10:40:44 -04:00
<a href="{{ $full.Permalink }}">
{{ if $.Params.thumbnails }}
2022-08-29 11:34:54 -04:00
{{ $title := .title }}
{{ with resources.Get (printf "%s-thumbs/%s" ($.Param "json") .filename) }}
2022-08-30 12:20:22 -04:00
<img alt="{{ $title }}" width="128" height="128" src="{{ .Permalink }}"/>
2022-08-29 11:34:54 -04:00
{{ else }}
<p>Thumbnail not found!</p>
{{ end }}
2022-08-24 10:40:44 -04:00
{{ else }}
<img alt="{{ .title }}" src="{{ $full.Permalink }}"/>
{{ end }}
</a>
2022-08-03 13:38:29 -04:00
2022-08-24 10:40:44 -04:00
<figcaption>
"{{ .title }}"
{{ if .newgrounds_url }}
<a href="{{ .newgrounds_url }}"><img alt="Newgrounds Icon" width="16" height="16" src="{{ $newgrounds_icon.Permalink }}"></a>
2022-08-24 10:40:44 -04:00
{{ end }}
{{ if .pixiv_url }}
<a href="{{ .pixiv_url }}"><img alt="Pixiv Icon" width="16" height="16" src="{{ $pixiv_icon.Permalink }}"></a>
2022-08-24 10:40:44 -04:00
{{ end }}
</figcaption>
</figure>
{{ end }}
2022-08-02 14:05:56 -04:00
{{ end }}
{{ end }}
{{ end }}