commit 62cd3764ce60982ba7cf4911499730f2b7451c99
parent 9526a7fc2baf79f987b3252f47649f4e764f514f
Author: Lou Woell <lou.woell@posteo.de>
Date:   Fri, 15 Nov 2024 17:21:15 +0100

Move layouts from my website to theme

Diffstat:
Alayouts/_default/about.html | 13+++++++++++++
Alayouts/home.html | 13+++++++++++++
Alayouts/shortcodes/image-gallery.html | 38++++++++++++++++++++++++++++++++++++++
Alayouts/shortcodes/toot.html | 6++++++
4 files changed, 70 insertions(+), 0 deletions(-)

diff --git a/layouts/_default/about.html b/layouts/_default/about.html @@ -0,0 +1,13 @@ +{{ define "main" }} +{{ partial "cover.html" . }} +{{ if .Title }} +<h1 class="post-title"> + <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> +</h1> +{{ end }} +{{ if .Content }} +<div class="index-content {{ if .Params.framed -}}framed{{- end -}}"> + {{ .Content }} +</div> +{{ end }} +{{ end }} diff --git a/layouts/home.html b/layouts/home.html @@ -0,0 +1,13 @@ +{{ define "main" }} +{{ partial "cover.html" . }} +{{ if .Title }} + <h1 class="post-title"> + <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> + </h1> +{{ end }} + {{ if .Content }} + <div class="index-content {{ if .Params.framed -}}framed{{- end -}}"> + {{ .Content }} + </div> + {{ end }} +{{ end }} diff --git a/layouts/shortcodes/image-gallery.html b/layouts/shortcodes/image-gallery.html @@ -0,0 +1,38 @@ +<style> + .image-gallery {overflow: auto; margin-left: -1%!important;} + .image-gallery li {float: left; display: block; margin: 0 0 1% 1%; width: 19%;} + .image-gallery li a {text-align: center; text-decoration: none!important; color: #777;} + .image-gallery li a span {display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; padding: 3px 0;} + .image-gallery li a img {width: 100%; display: block;} + .image-gallery .bigpic {max-height: 500px; display: block; margin: auto auto;} +</style> + +{{ $dir := string (.Get "gallery_dir") }} +<ul class="image-gallery"> + {{- range page.Resources.Match (printf "%s/*.*" $dir) -}} + {{- $imagetitle := index (split .Name ".") 0 -}} + <li onclick="embiggen(event)" > + <a href="{{ (.Fit "1600x1600 q50").Permalink }}" title="{{ $imagetitle }}" class="lightbox-image"> + <img src="{{ (.Fill "300x300 q50").Permalink }}" alt="{{ $imagetitle }}" title="{{ $imagetitle }}"> + <span>{{ $imagetitle }}</span> + </a> + </li> + {{ end }} + <img class="bigpic" src="" title="" > +</ul> + +<script> + function embiggen (e) { + + e.preventDefault() + + let img = e.target.parentElement + let big = e.currentTarget.parentElement.lastElementChild + + if (big.src == img.href) + big.src = "" + else + big.src = img.href + + } +</script> diff --git a/layouts/shortcodes/toot.html b/layouts/shortcodes/toot.html @@ -0,0 +1,6 @@ +<iframe src="{{ .Get "link" }}/embed" + class="mastodon-embed" style="max-width: 100%; border: 0" width="400" + allowfullscreen="allowfullscreen"></iframe> +<script + src="https://todon.nl/embed.js" async="async"> +</script>