diff options
author | tdro <tdro@noreply.example.com> | 2022-07-20 11:51:52 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-07-20 11:51:52 -0400 |
commit | a36e6284b7784f1b565e3dd37af26817842be0c9 (patch) | |
tree | 9fd35ed38591d1e9e5e550573afd4ca81edf08b9 /themes/default | |
parent | fa5c5c97b0c19ec7d610f65aa467c1125c23bd1a (diff) | |
download | canory-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')
-rw-r--r-- | themes/default/layouts/_default/_markup/render-image.html | 10 | ||||
-rw-r--r-- | themes/default/layouts/partials/video-container.html | 4 |
2 files changed, 7 insertions, 7 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 }}" diff --git a/themes/default/layouts/partials/video-container.html b/themes/default/layouts/partials/video-container.html index 3f747e7..d114332 100644 --- a/themes/default/layouts/partials/video-container.html +++ b/themes/default/layouts/partials/video-container.html @@ -16,14 +16,14 @@ {{- else -}} {{- end -}} {{- $cache = . | resources.Copy $fileCache -}} - {{- $cache = $cache.RelPermalink -}} + {{- $cache = $cache.Permalink -}} {{- else -}} {{- $caption = "No remote video data found for source" -}} {{- end -}} {{- else -}} {{- $cache = resources.Get (path.Join "public/" $fileCache) -}} {{- $cache = $cache.Content | resources.FromString $fileCache -}} - {{- $cache = $cache.RelPermalink -}} + {{- $cache = $cache.Permalink -}} {{- end -}} <video-container> |