aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/function-caches-images.html
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-09-03 19:41:26 -0400
committertdro <tdro@noreply.example.com>2022-09-03 19:41:26 -0400
commitd47d872c04e73ae7a7c3cc763319026e3a3e954b (patch)
tree0b79fa105f42ba5363215c3b163e36b6ad2653d8 /themes/default/layouts/partials/function-caches-images.html
parenta8b337f2d6b72bf209128c6214375e0a1dbb672f (diff)
downloadcanory-d47d872c04e73ae7a7c3cc763319026e3a3e954b.tar.gz
canory-d47d872c04e73ae7a7c3cc763319026e3a3e954b.tar.bz2
canory-d47d872c04e73ae7a7c3cc763319026e3a3e954b.zip
themes/default/layouts/partials/function-caches-images: Namespace alternate copy
Make the name distinct, it might eventually be a slice.
Diffstat (limited to 'themes/default/layouts/partials/function-caches-images.html')
-rw-r--r--themes/default/layouts/partials/function-caches-images.html24
1 files changed, 12 insertions, 12 deletions
diff --git a/themes/default/layouts/partials/function-caches-images.html b/themes/default/layouts/partials/function-caches-images.html
index df5c17f..64e72a1 100644
--- a/themes/default/layouts/partials/function-caches-images.html
+++ b/themes/default/layouts/partials/function-caches-images.html
@@ -7,10 +7,10 @@
{{- $directory := path.Dir $copy -}}
{{- $basename := path.BaseName $copy -}}
{{- $type := strings.TrimPrefix "." (path.Ext $copy) -}}
-{{- $optimized := or .OptimizedCopy (print $directory "/" $basename ".webp") -}}
-{{- $optimizedType := strings.TrimPrefix "." (path.Ext $optimized) -}}
+{{- $alternateCopy := or .AlternateCopy (print $directory "/" $basename ".webp") -}}
+{{- $alternateType := strings.TrimPrefix "." (path.Ext $alternateCopy) -}}
{{- $isFile := ne (path.Base $copy) "." -}}
-{{- $cached := and $isFile (fileExists (print "public/" $copy)) (fileExists (print "public/" $optimized)) -}}
+{{- $cached := and $isFile (fileExists (print "public/" $copy)) (fileExists (print "public/" $alternateCopy)) -}}
{{- $local := print "public/" $source -}}
{{- $localized := fileExists $local -}}
@@ -41,9 +41,9 @@
)
-}}
{{- $image = .Content | resources.FromString (print $target (path.Base .)) -}}
- {{- with $fit -}} {{- $image = $image.Fit (print $fit " " $optimizedType) -}} {{- end -}}
- {{- with $resize -}} {{- $image = $image.Resize (print $resize " " $optimizedType) -}} {{- end -}}
- {{- $image = $image | resources.Copy $optimized -}}
+ {{- with $fit -}} {{- $image = $image.Fit (print $fit " " $alternateType) -}} {{- end -}}
+ {{- with $resize -}} {{- $image = $image.Resize (print $resize " " $alternateType) -}} {{- end -}}
+ {{- $image = $image | resources.Copy $alternateCopy -}}
{{-
$data = merge $data (dict
"OptPermalink" $image.Permalink
@@ -72,9 +72,9 @@
)
-}}
{{- $image = .Content | resources.FromString (print $target (path.Base .)) -}}
- {{- with $fit -}} {{- $image = $image.Fit (print $fit " " $optimizedType) -}} {{- end -}}
- {{- with $resize -}} {{- $image = $image.Resize (print $resize " " $optimizedType) -}} {{- end -}}
- {{- $image = $image | resources.Copy $optimized -}}
+ {{- with $fit -}} {{- $image = $image.Fit (print $fit " " $alternateType) -}} {{- end -}}
+ {{- with $resize -}} {{- $image = $image.Resize (print $resize " " $alternateType) -}} {{- end -}}
+ {{- $image = $image | resources.Copy $alternateCopy -}}
{{-
$data = merge $data (dict
"OptPermalink" $image.Permalink
@@ -97,9 +97,9 @@
)
-}}
{{- $image = .Content | resources.FromString (print $target (path.Base .)) -}}
- {{- with $fit -}} {{- $image = $image.Fit (print $fit " " $optimizedType) -}} {{- end -}}
- {{- with $resize -}} {{- $image = $image.Resize (print $resize " " $optimizedType) -}} {{- end -}}
- {{- $image = $image | resources.Copy $optimized -}}
+ {{- with $fit -}} {{- $image = $image.Fit (print $fit " " $alternateType) -}} {{- end -}}
+ {{- with $resize -}} {{- $image = $image.Resize (print $resize " " $alternateType) -}} {{- end -}}
+ {{- $image = $image | resources.Copy $alternateCopy -}}
{{-
$data = merge $data (dict
"OptPermalink" $image.Permalink