diff options
author | tdro <tdro@noreply.example.com> | 2022-07-10 00:09:15 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-07-10 00:09:15 -0400 |
commit | 56afea8037ba5476ac2338503e77d5a1fd82fb7f (patch) | |
tree | e27ee9928b6ccec3179fef8b6687ece085fa62d0 /themes/default/layouts/_default/_markup/render-image.html | |
parent | 734ca16734e01d4b2808e8468ecf7f863a5e32c5 (diff) | |
download | canory-56afea8037ba5476ac2338503e77d5a1fd82fb7f.tar.gz canory-56afea8037ba5476ac2338503e77d5a1fd82fb7f.tar.bz2 canory-56afea8037ba5476ac2338503e77d5a1fd82fb7f.zip |
themes/default/layouts/partials/function-paths: Collect paths functions here
Diffstat (limited to 'themes/default/layouts/_default/_markup/render-image.html')
-rw-r--r-- | themes/default/layouts/_default/_markup/render-image.html | 14 |
1 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 189ab5a..28e6792 100644 --- a/themes/default/layouts/_default/_markup/render-image.html +++ b/themes/default/layouts/_default/_markup/render-image.html @@ -9,7 +9,7 @@ {{- $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-media.html") "/" $author "/" $immutable -}} +{{- $fileCache := print (partial "function-paths.html" "media") "/" $author "/" $immutable -}} {{- if not (and (fileExists (print "public/" $fileCache ".webp")) (fileExists (print "public/" $fileCache (path.Ext $source)))) -}} {{- with $remote := resources.GetRemote $source -}} @@ -17,7 +17,7 @@ {{- if fileExists $public -}} {{- $local = resources.Get $public -}} {{- with $local -}} - {{- $local = .Content | resources.FromString (print (partial "function-paths-media.html") "/" $author "/" (path.Base .)) -}} + {{- $local = .Content | resources.FromString (print (partial "function-paths.html" "media") "/" $author "/" (path.Base .)) -}} {{- end -}} {{- $source = print ("" | absURL) $source -}} {{- else -}} @@ -29,12 +29,12 @@ {{- $source = $404image.RelPermalink -}} {{- end -}} {{- else -}} - {{- $cache = .Content | resources.FromString (print (partial "function-paths-media.html") "/" $author "/" (path.Base .)) -}} + {{- $cache = .Content | resources.FromString (print (partial "function-paths.html" "media") "/" $author "/" (path.Base .)) -}} {{- end -}} {{- end -}} {{- else -}} {{- $exists = resources.Get (print "public/" $fileCache (path.Ext $source)) -}} - {{- $exists = $exists.Content | resources.FromString (print (partial "function-paths-media.html") "/" $author "/" (path.Base $exists)) -}} + {{- $exists = $exists.Content | resources.FromString (print (partial "function-paths.html" "media") "/" $author "/" (path.Base $exists)) -}} {{ end }} {{- /* This comment removes trailing newlines and white spaces. */ -}} <figure> @@ -42,10 +42,10 @@ <picture> {{- with $local }} {{- $local = .Fit (print $dimensions " webp") }} - {{- $local = $local | resources.Copy (print (partial "function-paths-media.html") "/" $author "/" $immutable ".webp") }} + {{- $local = $local | resources.Copy (print (partial "function-paths.html" "media") "/" $author "/" $immutable ".webp") }} <source srcset="{{- $local.RelPermalink -}}" type="image/webp" /> {{- $local = .Fit $dimensions }} - {{- $local = $local | resources.Copy (print (partial "function-paths-media.html") "/" $author "/" $immutable (path.Ext $local)) }} + {{- $local = $local | resources.Copy (print (partial "function-paths.html" "media") "/" $author "/" $immutable (path.Ext $local)) }} {{- $width = $local.Width -}} {{- $height = $local.Height -}} {{- $writeToFile := $local.Permalink }} @@ -55,7 +55,7 @@ {{- $cache = $cache | resources.Copy (print $author "/media/" $immutable ".webp") }} <source srcset="{{- $cache.RelPermalink -}}" type="image/webp" /> {{- $cache = .Fit $dimensions }} - {{- $cache = $cache | resources.Copy (print (partial "function-paths-media.html") "/" $author "/" $immutable (path.Ext $cache)) }} + {{- $cache = $cache | resources.Copy (print (partial "function-paths.html" "media") "/" $author "/" $immutable (path.Ext $cache)) }} {{- $width = $cache.Width -}} {{- $height = $cache.Height -}} {{- $cache = $cache.RelPermalink }} |