summaryrefslogtreecommitdiff
path: root/themes/blowfish/layouts/_default/_markup/render-image.html
diff options
context:
space:
mode:
authorChristoph Cullmann <christoph@cullmann.io>2024-06-26 21:44:28 +0200
committerChristoph Cullmann <christoph@cullmann.io>2024-06-26 21:44:28 +0200
commit58e2c9ae87f09dac79ecf962331ae2c51f4ba7f1 (patch)
treed819d1747427f81d1883a715ec60d13d575053e4 /themes/blowfish/layouts/_default/_markup/render-image.html
parentb1a7697b03cfb0143af78993387f758836e842bf (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.html38
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 }}