aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/_markup/render-image.html
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-07-20 11:51:52 -0400
committertdro <tdro@noreply.example.com>2022-07-20 11:51:52 -0400
commita36e6284b7784f1b565e3dd37af26817842be0c9 (patch)
tree9fd35ed38591d1e9e5e550573afd4ca81edf08b9 /themes/default/layouts/_default/_markup/render-image.html
parentfa5c5c97b0c19ec7d610f65aa467c1125c23bd1a (diff)
downloadcanory-a36e6284b7784f1b565e3dd37af26817842be0c9.tar.gz
canory-a36e6284b7784f1b565e3dd37af26817842be0c9.tar.bz2
canory-a36e6284b7784f1b565e3dd37af26817842be0c9.zip
themes/default/layouts: Ensure permalinks on outgoing assets
RSS feed output adds double subdirectory causing 404s.
Diffstat (limited to 'themes/default/layouts/_default/_markup/render-image.html')
-rw-r--r--themes/default/layouts/_default/_markup/render-image.html10
1 files changed, 5 insertions, 5 deletions
diff --git a/themes/default/layouts/_default/_markup/render-image.html b/themes/default/layouts/_default/_markup/render-image.html
index 28e6792..463cc80 100644
--- a/themes/default/layouts/_default/_markup/render-image.html
+++ b/themes/default/layouts/_default/_markup/render-image.html
@@ -26,7 +26,7 @@
{{- $width = .Width -}}
{{- $height = .Height -}}
{{- end -}}
- {{- $source = $404image.RelPermalink -}}
+ {{- $source = $404image.Permalink -}}
{{- end -}}
{{- else -}}
{{- $cache = .Content | resources.FromString (print (partial "function-paths.html" "media") "/" $author "/" (path.Base .)) -}}
@@ -43,7 +43,7 @@
{{- with $local }}
{{- $local = .Fit (print $dimensions " webp") }}
{{- $local = $local | resources.Copy (print (partial "function-paths.html" "media") "/" $author "/" $immutable ".webp") }}
- <source srcset="{{- $local.RelPermalink -}}" type="image/webp" />
+ <source srcset="{{- $local.Permalink -}}" type="image/webp" />
{{- $local = .Fit $dimensions }}
{{- $local = $local | resources.Copy (print (partial "function-paths.html" "media") "/" $author "/" $immutable (path.Ext $local)) }}
{{- $width = $local.Width -}}
@@ -53,12 +53,12 @@
{{- with $cache }}
{{- $cache = .Fit (print $dimensions " webp") }}
{{- $cache = $cache | resources.Copy (print $author "/media/" $immutable ".webp") }}
- <source srcset="{{- $cache.RelPermalink -}}" type="image/webp" />
+ <source srcset="{{- $cache.Permalink -}}" type="image/webp" />
{{- $cache = .Fit $dimensions }}
{{- $cache = $cache | resources.Copy (print (partial "function-paths.html" "media") "/" $author "/" $immutable (path.Ext $cache)) }}
{{- $width = $cache.Width -}}
{{- $height = $cache.Height -}}
- {{- $cache = $cache.RelPermalink }}
+ {{- $cache = $cache.Permalink }}
{{- end -}}
{{- with $exists }}
{{- if fileExists (print "public/" $fileCache ".webp") -}}
@@ -69,7 +69,7 @@
{{- end -}}
{{- $width = .Width -}}
{{- $height = .Height -}}
- {{- $cache = .RelPermalink }}
+ {{- $cache = .Permalink }}
{{- end -}}
<img loading="lazy"
src="{{ or $cache $source }}"