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

61 lines
2.3 KiB
HTML

{{ define "main" }}
<h2>{{ .Title }}</h2>
{{ .Content }}
{{ $art := (index site.Data ($.Param "json")) }}
{{ $pixiv_icon := resources.Get "pixiv.webp" }}
{{ $newgrounds_icon := resources.Get "newgrounds.webp" }}
{{ range $art.categories }}
<h3>{{ .name }}</h3>
<p>{{ .description }}</p>
{{ range sort .years "year" "desc" }}
<h4>{{ .year }}</h4>
<div class="gallery-con">
{{ range .pieces }}
<figure class="gallery-fig">
{{ $full := resources.Get (printf "%s/%s" ($.Param "json") .filename) }}
{{ if $full }}
<a href="{{ $full.Permalink }}" aria-label="Click to view full-size image">
{{ if $.Params.thumbnails }}
{{ $title := .title }}
{{ with resources.Get (printf "%s-thumbs/%s" ($.Param "json") .filename) }}
<img class="gallery-img" alt="{{ $title }}" width="128" height="128" src="{{ .Permalink }}"/>
{{ else }}
<p>Thumbnail not found!</p>
{{ end }}
{{ else }}
<img alt="{{ .title }}" src="{{ $full.Permalink }}"/>
{{ end }}
</a>
<figcaption>
{{ with .title }}
"{{ . }}"
{{ end }}
{{ if .newgrounds_url }}
<a href="{{ .newgrounds_url }}" style="vertical-align: bottom"><img alt="Newgrounds Icon" style="vertical-align: bottom" width="19" height="19" src="{{ $newgrounds_icon.Permalink }}"></a>
{{ end }}
{{ if .pixiv_url }}
<a href="{{ .pixiv_url }}" style="vertical-align: bottom"><img alt="Pixiv Icon" style="vertical-align: bottom" width="19" height="19" src="{{ $pixiv_icon.Permalink }}"></a>
{{ end }}
</figcaption>
{{ else }}
<em>CANNOT FIND {{.filename }}</em>
{{ end }}
</figure>
{{ end }}
</div>
{{ end }}
<hr>
{{ end }}
{{ end }}