diff options
author | tdro <tdro@noreply.example.com> | 2022-09-03 19:41:26 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-09-03 19:41:26 -0400 |
commit | d47d872c04e73ae7a7c3cc763319026e3a3e954b (patch) | |
tree | 0b79fa105f42ba5363215c3b163e36b6ad2653d8 /themes/default | |
parent | a8b337f2d6b72bf209128c6214375e0a1dbb672f (diff) | |
download | canory-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')
5 files changed, 16 insertions, 16 deletions
diff --git a/themes/default/layouts/_default/rss.xml b/themes/default/layouts/_default/rss.xml index 2a85b8f..0173524 100644 --- a/themes/default/layouts/_default/rss.xml +++ b/themes/default/layouts/_default/rss.xml @@ -20,7 +20,7 @@ "Fit" "160x160" "Target" (print (partial "function-paths.html" "media") "/" $author.user "/") "Copy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.Base $profile)) - "OptimizedCopy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.BaseName $profile) ".webp") + "AlternateCopy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.BaseName $profile) ".webp") ) -}} diff --git a/themes/default/layouts/partials/author-card.html b/themes/default/layouts/partials/author-card.html index 557abdd..7f8a5d6 100644 --- a/themes/default/layouts/partials/author-card.html +++ b/themes/default/layouts/partials/author-card.html @@ -11,7 +11,7 @@ "Fit" "160x160" "Target" (print (partial "function-paths.html" "media") "/" .Data.user "/") "Copy" (print (partial "function-paths.html" "media") "/" .Data.user "/" (path.Base $profile)) - "OptimizedCopy" (print (partial "function-paths.html" "media") "/" .Data.user "/" (path.BaseName $profile) ".webp") + "AlternateCopy" (print (partial "function-paths.html" "media") "/" .Data.user "/" (path.BaseName $profile) ".webp") ) -}} diff --git a/themes/default/layouts/partials/author-header.html b/themes/default/layouts/partials/author-header.html index ddb4724..b1b1634 100644 --- a/themes/default/layouts/partials/author-header.html +++ b/themes/default/layouts/partials/author-header.html @@ -12,7 +12,7 @@ "Resize" "x600" "Target" (print (partial "function-paths.html" "media") "/" $author.user "/") "Copy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.Base $header)) - "OptimizedCopy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.BaseName $header) ".webp") + "AlternateCopy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.BaseName $header) ".webp") ) -}} diff --git a/themes/default/layouts/partials/author-picture.html b/themes/default/layouts/partials/author-picture.html index ad878bf..d5d87f4 100644 --- a/themes/default/layouts/partials/author-picture.html +++ b/themes/default/layouts/partials/author-picture.html @@ -12,7 +12,7 @@ "Fit" "160x160" "Target" (print (partial "function-paths.html" "media") "/" $author.user "/") "Copy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.Base $profile)) - "OptimizedCopy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.BaseName $profile) ".webp") + "AlternateCopy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.BaseName $profile) ".webp") ) -}} 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 |