diff options
author | Christoph Cullmann <christoph@cullmann.io> | 2024-06-26 21:44:28 +0200 |
---|---|---|
committer | Christoph Cullmann <christoph@cullmann.io> | 2024-06-26 21:44:28 +0200 |
commit | 58e2c9ae87f09dac79ecf962331ae2c51f4ba7f1 (patch) | |
tree | d819d1747427f81d1883a715ec60d13d575053e4 /themes/blowfish/layouts/_default/_markup/render-image.html | |
parent | b1a7697b03cfb0143af78993387f758836e842bf (diff) |
update the theme
Diffstat (limited to 'themes/blowfish/layouts/_default/_markup/render-image.html')
-rw-r--r-- | themes/blowfish/layouts/_default/_markup/render-image.html | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/themes/blowfish/layouts/_default/_markup/render-image.html b/themes/blowfish/layouts/_default/_markup/render-image.html index db9ebd2..3e5fdce 100644 --- a/themes/blowfish/layouts/_default/_markup/render-image.html +++ b/themes/blowfish/layouts/_default/_markup/render-image.html @@ -1,29 +1,29 @@ -{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} -{{ $url := urls.Parse .Destination }} -{{ $altText := .Text }} -{{ $caption := .Title }} -{{ if findRE "^https?" $url.Scheme }} +{{- $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} +{{- $url := urls.Parse .Destination }} +{{- $altText := .Text }} +{{- $caption := .Title }} +{{- if findRE "^https?" $url.Scheme }} <figure> <img class="my-0 rounded-md" loading="lazy" src="{{ $url.String }}" alt="{{ $altText }}" /> {{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }} </figure> -{{ else }} - {{ $resource := "" }} - {{ if $.Page.Resources.GetMatch ($url.String) }} - {{ $resource = $.Page.Resources.GetMatch ($url.String) }} - {{ else if resources.GetMatch ($url.String) }} - {{ $resource = resources.Get ($url.String) }} - {{ end }} - {{ with $resource }} +{{- else }} + {{- $resource := "" }} + {{- if $.Page.Resources.GetMatch ($url.String) }} + {{- $resource = $.Page.Resources.GetMatch ($url.String) }} + {{- else if resources.GetMatch ($url.String) }} + {{- $resource = resources.Get ($url.String) }} + {{- end }} + {{- with $resource }} <figure> - {{ if $disableImageOptimization }} + {{- if or $disableImageOptimization (eq .MediaType.SubType "svg")}} <img class="my-0 rounded-md" loading="lazy" src="{{ .RelPermalink }}" alt="{{ $altText }}" /> - {{ else }} + {{- else }} <img class="my-0 rounded-md" loading="lazy" @@ -35,13 +35,13 @@ src="{{ (.Resize "660x").RelPermalink }}" alt="{{ $altText }}" /> - {{ end }} + {{- end }} {{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }} </figure> - {{ else }} + {{- else }} <figure> <img class="my-0 rounded-md" loading="lazy" src="{{ $url.String }}" alt="{{ $altText }}" /> {{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }} </figure> - {{ end }} -{{ end }} + {{- end }} +{{- end }} |