152 lines
5.5 KiB
HTML
152 lines
5.5 KiB
HTML
{{/* Page layout used for art details view, when visiting a specific artwork. */}}
|
|
|
|
{{ define "main" }}
|
|
<h2>{{ .Title }}</h2>
|
|
|
|
<hr>
|
|
|
|
{{ if (and (not $.Params.animation) (and (not (in .File.Dir "art/guest")) (and (not $.Params.threed) (not $.Params.comic) )) ) }}
|
|
{{ $full := printf "%s/art/%s.avif" $.Site.Params.image_host $.Params.slug }}
|
|
{{ $jpeg := printf "%s/art/%s.jpg" $.Site.Params.image_host $.Params.slug }}
|
|
|
|
<picture>
|
|
<source srcset="{{ $full }}" type="image/avif" width="{{ $.Params.width }}" height="{{ $.Params.height }}"/>
|
|
<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 }}" width="{{ $.Params.width }}" height="{{ $.Params.height }}" src="{{ $jpeg }}"/>
|
|
</picture>
|
|
{{ else }}
|
|
|
|
{{ if $.Params.threed }}
|
|
{{ $file := printf "%s/3d/%s.glb" $.Site.Params.image_host $.Params.slug }}
|
|
{{ with $file }}
|
|
{{ $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>
|
|
{{ end }}
|
|
{{ else }}
|
|
{{ $file := printf "%s/animation/%s.webm" $.Site.Params.image_host $.Params.slug }}
|
|
{{ with $file }}
|
|
{{ if $.Params.animation }}
|
|
<div style="text-align: center;">
|
|
<video style="max-width: 100%" class="gallery-img" controls loop>
|
|
<source src="{{ . }}" type="video/webm">
|
|
</video>
|
|
</div>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if $.Params.comic }}
|
|
{{ range $.Params.pages }}
|
|
{{ $full := printf "%s/art/%s.avif" $.Site.Params.image_host .filename }}
|
|
{{ $jpeg := printf "%s/art/%s.jpg" $.Site.Params.image_host .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 }}
|
|
|
|
{{ partial "voting" . }}
|
|
|
|
<table>
|
|
<tr>
|
|
<th>{{ i18n "date" }}</th>
|
|
<td>
|
|
<time datetime="{{ .Page.Lastmod.Format "2006-01-02" }}" class="text-muted">
|
|
{{ $.Date.Format "January 2006" }}
|
|
</time>
|
|
</td>
|
|
</tr>
|
|
|
|
{{ with .Params.arttags }}
|
|
<tr>
|
|
<th>{{ i18n "tags" }}</th>
|
|
<td>
|
|
{{ $len := (len .) }}
|
|
{{ range $index, $element := . }}
|
|
<a href="/art/tags/{{ urlize . }}/"><strong>{{ strings.Title $element }}</strong></a>{{ if not (eq (add $index 1) $len) }},{{ end }}
|
|
{{ end }}
|
|
</td>
|
|
</tr>
|
|
{{ end }}
|
|
|
|
{{ with .Params.characters }}
|
|
<tr>
|
|
<th>{{ i18n "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 }}
|
|
|
|
{{ with .Params.artist }}
|
|
<tr>
|
|
<th>Artist</th>
|
|
<td>
|
|
{{ . }}
|
|
</td>
|
|
</tr>
|
|
{{ end }}
|
|
|
|
{{ with .Params.program }}
|
|
<tr>
|
|
<th>Program</th>
|
|
<td>
|
|
{{ . }}
|
|
</td>
|
|
</tr>
|
|
{{ end }}
|
|
|
|
{{ with .Params.mastodon_url }}
|
|
<tr>
|
|
<th>Mastodon URL</th>
|
|
<td>
|
|
<a href="{{ . }}">Mastodon Post</a>
|
|
</td>
|
|
</tr>
|
|
{{ end }}
|
|
|
|
{{ with .Params.newgrounds_url }}
|
|
<tr>
|
|
<th>Newgrounds URL</th>
|
|
<td>
|
|
<a href="{{ . }}">Newgrounds Post</a>
|
|
</td>
|
|
</tr>
|
|
{{ end }}
|
|
|
|
|
|
{{ with .Params.pixiv_url }}
|
|
<tr>
|
|
<th>Pixiv URL</th>
|
|
<td>
|
|
<a href="{{ . }}">Pixiv Post</a>
|
|
</td>
|
|
</tr>
|
|
{{ end }}
|
|
</table>
|
|
|
|
{{ with .Content }}
|
|
{{ $.Scratch.Set "header-type" "h3" }}
|
|
{{ $.Scratch.Set "header-name" "Commentary" }}
|
|
{{ partial "fake-heading.html" $ }}
|
|
|
|
{{ . }}
|
|
{{ end }}
|
|
|
|
{{ 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 }}
|
|
|
|
{{ partial "comments" . }}
|
|
{{ end }}
|