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

61 lines
2.2 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.webp" }}
{{ $newgrounds_icon := resources.Get "newgrounds.webp" }}
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-10-25 16:08:36 -04:00
<div class="gallery-con">
2022-08-03 13:38:29 -04:00
{{ range .pieces }}
2022-10-25 16:08:36 -04:00
<figure class="gallery-fig">
2022-08-22 17:04:33 -04:00
{{ $full := resources.Get (printf "%s/%s" ($.Param "json") .filename) }}
{{ if $full }}
2022-08-02 14:05:56 -04:00
<a href="{{ $full.Permalink }}" aria-label="Click to view full-size image">
2022-08-24 10:40:44 -04:00
{{ if $.Params.thumbnails }}
2022-08-29 11:34:54 -04:00
{{ $title := .title }}
{{ with resources.Get (printf "%s-thumbs/%s" ($.Param "json") .filename) }}
2022-10-25 16:05:48 -04:00
<img class="gallery-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>
{{ with .title }}
"{{ . }}"
{{ end }}
2022-08-24 10:40:44 -04:00
{{ 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>
{{ else }}
<em>CANNOT FIND {{.filename }}</em>
{{ end }}
2022-08-24 10:40:44 -04:00
</figure>
{{ end }}
2022-10-25 16:08:36 -04:00
</div>
2022-08-02 14:05:56 -04:00
{{ end }}
<hr>
2022-08-02 14:05:56 -04:00
{{ end }}
{{ end }}