redstrate.com/themes/red/layouts/partials/render-art.html

57 lines
2.8 KiB
HTML
Raw Normal View History

2024-09-30 17:40:46 -04:00
{{/* Partial used to display a thumbnail of an artwork. */}}
2023-04-13 17:19:53 -04:00
2024-10-13 20:32:26 -04:00
{{ $full := printf "%s/thumb/%s.avif" $.Site.Params.image_host .Params.filename }}
{{ $jpeg := printf "%s/thumb/%s.jpg" $.Site.Params.image_host .Params.filename }}
2024-10-17 13:53:59 -04:00
{{ $grid_class := "grid-item" }}
{{ if ge $.Params.aspect_ratio 1 }}
{{ $grid_class = "grid-item-wide" }}
{{ end }}
2024-09-30 17:40:46 -04:00
<a aria-label="Gallery Item" class="no-decoration grid-item" href="{{ .RelPermalink }}">
2023-04-13 11:45:52 -04:00
2024-09-30 17:40:46 -04:00
{{ $title := .Title }}
{{ $year := .Date.Format "2006" }}
2023-02-10 14:25:28 -05:00
2024-09-30 17:40:46 -04:00
{{ with $full }}
2024-10-17 13:53:59 -04:00
<picture>
<source srcset="{{ $full }}" type="image/avif" width="{{ $.Params.thumb_width }}" height="{{ $.Params.thumb_height }}"/>
<img style="width: 100%; height: auto;" alt="{{ $.Params.alt_text }}" width="{{ $.Params.thumb_width }}" height="{{ $.Params.thumb_height }}" src="{{ $jpeg }}"/>
</picture>
<span>
{{ $title }}, {{ $year }}
2024-09-30 17:40:46 -04:00
{{ if $.Params.threed }}
2024-10-17 13:53:59 -04:00
{{ with resources.Get "icons/3d.svg" }}
<img class="symbolic-icon" style="float: right;margin-right: 6px;margin-top: 2px;" width="16" height="16" alt="3D cube icon" title="Viewable 3D Model" src="{{ .RelPermalink }}">
{{ end }}
2024-10-17 13:53:59 -04:00
{{ else }}
{{ if $.Params.comic }}
{{ with resources.Get "icons/comic.svg" }}
<img class="symbolic-icon" style="float: right;margin-right: 6px;margin-top: 2px;" width="16" height="16" alt="Comic icon" title="Viewable Comic" src="{{ .RelPermalink }}">
{{ end }}
{{ else }}
{{ if $.Params.animation }}
{{ with resources.Get "icons/animation.svg" }}
<img class="symbolic-icon" style="float: right;margin-right: 6px;margin-top: 2px;" width="16" height="16" alt="Play animation icon" title="Viewable Animation" src="{{ .RelPermalink }}">
{{ end }}
{{ else }}
{{ with resources.Get "icons/image.svg" }}
<img class="symbolic-icon" style="float: right;margin-right: 6px;margin-top: 2px;" width="16" height="16" alt="Image icon" title="Viewable Image" src="{{ .RelPermalink }}">
{{ end }}
{{ end }}
2024-03-31 12:32:05 -04:00
{{ end }}
2024-09-30 17:40:46 -04:00
{{ end }}
2024-03-31 12:32:05 -04:00
2024-10-17 13:53:59 -04:00
{{ if $.Params.nsfw }}
{{ with resources.Get "icons/warning.svg" }}
<img style="float: right;margin-right: 6px;margin-top: 2px;" width="16" height="16" alt="Adult content icon" title="Contains adult content" src="{{ .RelPermalink }}">
{{ end }}
{{ end }}
2024-10-17 13:53:59 -04:00
</span>
2022-12-28 10:24:59 -05:00
{{ end }}
2024-09-30 17:40:46 -04:00
</a>
2023-04-13 11:45:52 -04:00