FIX theme toggler CHANGE image optimization ADD custom markdown image rendering

This commit is contained in:
Hoernschen 2024-01-15 22:55:39 +01:00
parent a841050e84
commit 07f46720f8
Signed by: hoernschen
GPG key ID: 37591FAF4E6D3462
11 changed files with 81 additions and 59 deletions

View file

@ -0,0 +1,15 @@
{{ $caption := .Title }}
{{ $alt := .Text }}
{{ $img := .Page.Resources.GetMatch .Destination }}
{{ if not $img }}
{{ $img = resources.Get .Destination }}
{{ if not $img }}
{{ $img := resources.GetRemote .Destination | resources.Copy (path.Join "images" (path.Base .Destination)) }}
{{ end }}
{{ end }}
{{ with $img }}
{{ partial "components/image.html" (dict "url" .RelPermalink "alt" $alt "width" .Width "height" .Height) }}
<p class="caption">{{ $caption }}</p>
{{ end }}