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

51 lines
2 KiB
HTML

{{ define "main" }}
<h2>{{ .Title }}</h2>
{{ .Content }}
{{ $art := (index site.Data ($.Param "json")) }}
{{ $pixiv_icon := resources.Get "pixiv.png" }}
{{ $newgrounds_icon := resources.Get "newgrounds.png" }}
{{ 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) }}
<a href="{{ $full.Permalink }}">
{{ 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 }}"><img alt="Newgrounds Icon" width="16" height="16" src="{{ $newgrounds_icon.Permalink }}"></a>
{{ end }}
{{ if .pixiv_url }}
<a href="{{ .pixiv_url }}"><img alt="Pixiv Icon" width="16" height="16" src="{{ $pixiv_icon.Permalink }}"></a>
{{ end }}
</figcaption>
</figure>
{{ end }}
</div>
{{ end }}
{{ end }}
{{ end }}