From b8b1cba41c944610f4d51d6368902425d5c32143 Mon Sep 17 00:00:00 2001 From: tdro Date: Thu, 2 Nov 2023 11:11:08 -0400 Subject: themes/default/layouts: Namespacing --- themes/default/layouts/_default/_markup/render-image.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'themes/default/layouts/_default') diff --git a/themes/default/layouts/_default/_markup/render-image.html b/themes/default/layouts/_default/_markup/render-image.html index 6f702e3..116d280 100644 --- a/themes/default/layouts/_default/_markup/render-image.html +++ b/themes/default/layouts/_default/_markup/render-image.html @@ -13,8 +13,8 @@ {{- $author := .Page.Section -}} {{- $relURL := strings.TrimPrefix .Page.Site.BaseURL .Page.Permalink -}} {{- $immutable := print ($relURL | humanize | urlize) "-" ($source | sha256 | truncate 8 "") -}} -{{- $fileCache := print (partial "function-paths.html").media "/" $author "/" $immutable -}} -{{- $cached := and (fileExists (print "public/" $fileCache ".webp")) (fileExists (print "public/" $fileCache (path.Ext $source))) -}} +{{- $storage := print (partial "function-paths.html").media "/" $author "/" $immutable -}} +{{- $cached := and (fileExists (print "public/" $storage ".webp")) (fileExists (print "public/" $storage (path.Ext $source))) -}} {{- if not $cached -}} {{- with $remote := cond (default true $.Page.Site.Params.site.offline) false (resources.GetRemote $source) -}} @@ -38,7 +38,7 @@ {{- end -}} {{- end -}} {{- else -}} - {{- $exists = resources.Get (print "public/" $fileCache (path.Ext $source)) -}} + {{- $exists = resources.Get (print "public/" $storage (path.Ext $source)) -}} {{- $exists = $exists.Content | resources.FromString (print (partial "function-paths.html").media "/" $author "/" (path.Base $exists)) -}} {{- end -}} @@ -67,8 +67,8 @@ {{- end -}} {{- with $exists }} - {{- if fileExists (print "public/" $fileCache ".webp") -}} - {{- $srcset = print ("" | absURL) "/" $fileCache ".webp" -}} + {{- if fileExists (print "public/" $storage ".webp") -}} + {{- $srcset = print ("" | absURL) "/" $storage ".webp" -}} {{- end -}} {{- if fileExists (print "public/" $author "/media/" $immutable ".webp") -}} {{- $srcset = print ("" | absURL) "/" $author "/media/" $immutable ".webp" -}} -- cgit v1.2.3