diff options
Diffstat (limited to 'themes/24-unification/layouts/_default/comic.html')
-rw-r--r-- | themes/24-unification/layouts/_default/comic.html | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/themes/24-unification/layouts/_default/comic.html b/themes/24-unification/layouts/_default/comic.html new file mode 100644 index 0000000..1b3efde --- /dev/null +++ b/themes/24-unification/layouts/_default/comic.html @@ -0,0 +1,68 @@ +{{ define "main" }} + +{{- $path := .Params.assetPath}} +{{- $img := resources.Get $path }} + +{{ $mirror := where .Site.RegularPages ".Params.mirrorName" .Params.mirrorName}} + +<nav class="horizontal"> + {{- with $mirror.Next . }} + <a href="{{.Permalink}}">[previous]</a> + {{- end }} + + <a href="/mirror/userfriendly/">[index]</a> + + {{- with $mirror.Prev . }} + <a href="{{.Permalink}}">[next]</a> + {{- end }} +</a> +</nav> + +<article> + <h1 class="comic-title">Comic for + <time datetime="{{.PublishDate.Format "2006-01-02" }}"> + {{ .PublishDate.Format "Monday, 2 Jan 2006" }} + </time> + </h1> + {{ if gt $img.Width 0 }} + {{- $img2xproc := printf "x%d gif q90" (math.Mul 2 $img.Height) }} + {{- $img1x := $img }} + {{- $img2x := $img.Resize $img2xproc }} + <figure + class="centered" + style="padding: 10px" + > + <a href="{{ $img1x.Permalink }}"> + <img + src="{{ $img1x.Permalink }}" + srcset=" + {{ $img1x.Permalink }} 1x, + {{ $img2x.Permalink }} 2x + " + width="{{ $img1x.Width }}" + height="{{ $img1x.Height }}" + loading="lazy" + > + </a> + + {{ else }} + Corrupted image :-( + {{ end }} +</article> + +<nav class="horizontal"> + {{- with $mirror.Next . }} + <a href="{{.Permalink}}">[previous]</a> + {{- end }} + + <a href="/mirror/userfriendly/">[index]</a> + + {{- with $mirror.Prev . }} + <a href="{{.Permalink}}">[next]</a> + {{- end }} +</a> +</nav> + +{{ end }} + + |