diff options
author | tdro <tdro@noreply.example.com> | 2023-03-14 15:11:23 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-03-14 15:11:23 -0400 |
commit | ef2611e3c2c07b42f4c8d32ad8cce7d5d634e822 (patch) | |
tree | 8a87daba0eb4a355f732ec7e5f3bf3e9bfe3ad7b /themes/default/layouts/_default/_markup/render-image.html | |
parent | bde0c042a2d050a8549707f62dec57844c56a0c5 (diff) | |
download | canory-ef2611e3c2c07b42f4c8d32ad8cce7d5d634e822.tar.gz canory-ef2611e3c2c07b42f4c8d32ad8cce7d5d634e822.tar.bz2 canory-ef2611e3c2c07b42f4c8d32ad8cce7d5d634e822.zip |
themes/default/layouts/partials/function-paths: Return dict 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 1a003fc..b98efdf 100644 --- a/themes/default/layouts/_default/_markup/render-image.html +++ b/themes/default/layouts/_default/_markup/render-image.html @@ -13,7 +13,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.html" "media") "/" $author "/" $immutable -}} +{{- $fileCache := print (partial "function-paths.html").media "/" $author "/" $immutable -}} {{- $cached := and (fileExists (print "public/" $fileCache ".webp")) (fileExists (print "public/" $fileCache (path.Ext $source))) -}} {{- if not $cached -}} @@ -22,7 +22,7 @@ {{- if fileExists $public -}} {{- $local = resources.Get $public -}} {{- with $local -}} - {{- $local = .Content | resources.FromString (print (partial "function-paths.html" "media") "/" $author "/" (path.Base .)) -}} + {{- $local = .Content | resources.FromString (print (partial "function-paths.html").media "/" $author "/" (path.Base .)) -}} {{- end -}} {{- $source = print ("" | absURL) $source -}} {{- else -}} @@ -34,20 +34,20 @@ {{- $source = $404image.Permalink -}} {{- end -}} {{- else -}} - {{- $cache = .Content | resources.FromString (print (partial "function-paths.html" "media") "/" $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.html" "media") "/" $author "/" (path.Base $exists)) -}} + {{- $exists = $exists.Content | resources.FromString (print (partial "function-paths.html").media "/" $author "/" (path.Base $exists)) -}} {{- end -}} {{- with $local }} {{- $local = .Fit (print $dimensions " webp") }} - {{- $local = $local | resources.Copy (print (partial "function-paths.html" "media") "/" $author "/" $immutable ".webp") }} + {{- $local = $local | resources.Copy (print (partial "function-paths.html").media "/" $author "/" $immutable ".webp") }} {{- $srcset = $local.Permalink -}} {{- $local = .Fit $dimensions }} - {{- $local = $local | resources.Copy (print (partial "function-paths.html" "media") "/" $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 -}} {{- $colors = $local.Colors -}} @@ -59,7 +59,7 @@ {{- $cache = $cache | resources.Copy (print $author "/media/" $immutable ".webp") }} {{- $srcset = $cache.Permalink -}} {{- $cache = .Fit $dimensions }} - {{- $cache = $cache | resources.Copy (print (partial "function-paths.html" "media") "/" $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 -}} {{- $colors = $cache.Colors -}} |