redstrate.com/themes/red/layouts/_default/art-detail.html

160 lines
5.5 KiB
HTML
Raw Normal View History

2022-12-20 19:16:53 -05:00
{{ define "main" }}
{{ with .Title }}
<h2>{{ . }}</h2>
{{ else }}
<h2>Untitled Artwork</h2>
{{ end }}
2023-02-23 17:39:20 -05:00
<hr>
{{ $month := 1 }}
{{ $year := 1 }}
{{ if .Params.date }}
{{ $split := split .Params.date "-" }}
{{ $year = int (index $split 0) }}
{{ $month = int (index $split 3) }}
{{ end }}
{{ if (and (not $.Params.animation) (and (not (in .File.Dir "art/guest")) (and (not $.Params.threed) (not $.Params.comic) )) ) }}
{{ $full := printf "https://images.redstrate.com/art/%s.avif" $.Params.slug }}
{{ $jpeg := printf "https://images.redstrate.com/art/%s.jpg" $.Params.slug }}
<picture>
<source srcset="{{ $full }}" type="image/avif"/>
2024-02-19 17:54:20 -05:00
<img class="gallery-img" style="display: block; max-height: 1000px; margin-left: auto; margin-right: auto; width: auto; margin-top: 10px; margin-bottom: 10px; max-width: 100%; height: auto" alt="{{ $.Params.alt_text }}" src="{{ $jpeg }}"/>
</picture>
{{ else }}
{{ $file := printf "https://images.redstrate.com%s" $.Params.filename }}
{{ with $file }}
{{ if $.Params.threed }}
{{ $cameraorbit := $.Params.orbit }}
{{ $cameratarget := $.Params.target }}
{{ $fov := $.Params.fov }}
<model-viewer style="margin-top: 10px; margin-bottom: 10px;" class="gallery-img" alt="{{ $.Params.alt_text }}" title="{{ $.Params.alt_text }}" src="{{ . }}" shadow-intensity="1" camera-controls touch-action="pan-y" camera-orbit="{{ $cameraorbit }}" camera-target="{{ $cameratarget }}" field-of-view="{{ $fov }}"></model-viewer>
{{ else }}
{{ if $.Params.animation }}
<div style="text-align: center;">
<video style="max-width: 100%" class="gallery-img" controls>
<source src="{{ . }}" type="video/webm">
</video>
</div>
{{ end }}
{{ end }}
2023-04-13 11:45:52 -04:00
{{ end }}
2022-12-28 11:12:01 -05:00
{{ end }}
2022-12-20 19:16:53 -05:00
2024-03-31 12:32:05 -04:00
{{ if $.Params.comic }}
{{ range $.Params.pages }}
{{ $full := printf "https://images.redstrate.com/art/%s.avif" .filename }}
{{ $jpeg := printf "https://images.redstrate.com/art/%s.jpg" .filename}}
<picture>
<source srcset="{{ $full }}" type="image/avif"/>
<img class="gallery-img" style="display: block; max-height: 1000px; margin-left: auto; margin-right: auto; width: auto; margin-top: 10px; margin-bottom: 10px; max-width: 100%; height: auto" alt="{{ .alt_text }}" src="{{ $jpeg }}"/>
</picture>
{{ end }}
{{ end }}
2023-09-04 07:59:34 -04:00
{{ partial "voting" . }}
2022-12-27 21:47:12 -05:00
<table>
2022-12-27 22:34:31 -05:00
<tr>
2023-04-17 15:29:13 -04:00
<th>Date</th>
2022-12-27 22:34:31 -05:00
<td>
2023-04-17 15:29:13 -04:00
<time datetime="{{ .Page.Lastmod.Format "2006-01-02" }}" class="text-muted">
{{ $.Date.Format "January 2006" }}
</time>
2022-12-27 22:34:31 -05:00
</td>
</tr>
2023-03-25 11:24:12 -04:00
2023-04-17 15:29:13 -04:00
{{ with .Params.arttags }}
<tr>
<th>Tags</th>
<td>
{{ $len := (len .) }}
{{ range $index, $element := . }}
<a href="/art/tags/{{ urlize . }}/"><strong>{{ $element }}</strong></a>{{ if not (eq (add $index 1) $len) }},{{ end }}
{{ end }}
</td>
</tr>
{{ end }}
2023-03-26 13:54:00 -04:00
2023-04-17 15:29:13 -04:00
{{ with .Params.characters }}
<tr>
<th>Characters</th>
<td>
{{ $len := (len .) }}
{{ range $index, $element := . }}
<a href="/art/characters/{{ urlize .}}/"><strong>{{ $element }}</strong></a>{{ if not (eq (add $index 1) $len) }},{{ end }}
{{ end }}
</td>
</tr>
{{ end }}
2023-03-25 11:24:12 -04:00
2023-07-02 22:24:51 -04:00
{{ with .Params.artist }}
<tr>
<th>Artist</th>
<td>
{{ . }}
</td>
</tr>
{{ end }}
2023-04-17 15:29:13 -04:00
{{ with .Params.program }}
<tr>
<th>Program</th>
<td>
{{ . }}
</td>
</tr>
{{ end }}
2023-03-25 11:24:12 -04:00
2023-04-17 15:29:13 -04:00
{{ with .Params.mastodon_url }}
<tr>
<th>Mastodon URL</th>
<td>
2023-04-29 22:01:25 -04:00
<a href="{{ . }}">Mastodon Post</a>
2023-04-17 15:29:13 -04:00
</td>
</tr>
{{ end }}
2023-03-25 11:24:12 -04:00
2023-04-17 15:29:13 -04:00
{{ with .Params.newgrounds_url }}
<tr>
<th>Newgrounds URL</th>
<td>
2023-04-29 22:01:25 -04:00
<a href="{{ . }}">Newgrounds Post</a>
2023-04-17 15:29:13 -04:00
</td>
</tr>
{{ end }}
2023-03-25 11:24:12 -04:00
2023-04-17 15:29:13 -04:00
{{ with .Params.pixiv_url }}
<tr>
<th>Pixiv URL</th>
<td>
2023-04-29 22:01:25 -04:00
<a href="{{ . }}">Pixiv Post</a>
2023-04-17 15:29:13 -04:00
</td>
</tr>
{{ end }}
2022-12-27 21:47:12 -05:00
</table>
2022-12-20 19:16:53 -05:00
2023-03-08 10:42:43 -05:00
{{ with .Content }}
{{ $.Scratch.Set "header-type" "h3" }}
{{ $.Scratch.Set "header-name" "Commentary" }}
{{ partial "fake-heading.html" $ }}
2022-12-28 11:09:13 -05:00
{{ . }}
2023-03-08 10:42:43 -05:00
{{ end }}
2022-12-28 11:09:13 -05:00
2023-04-13 11:45:52 -04:00
{{ if .Params.threed }}
{{ $site := resources.Get "js/model-viewer.min.js" }}
{{ if hugo.IsProduction }}
{{ $site = $site | fingerprint | resources.PostProcess }}
{{ end }}
<script type="module" src="{{ $site.RelPermalink }}" integrity="{{ $site.Data.Integrity }}"></script>
{{ end }}
2022-12-27 22:34:31 -05:00
{{ partial "comments" . }}
2022-12-20 19:16:53 -05:00
{{ end }}