aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/_markup/render-image.html
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-06-01 19:16:58 -0400
committertdro <tdro@noreply.example.com>2022-06-01 19:16:58 -0400
commit473a08150b875112c522522e21fb542d3ec26736 (patch)
treeec1d5f7c9e7ce80d5d2073490ff6a35f5351b6a1 /themes/default/layouts/_default/_markup/render-image.html
parentdff47d17bb0ed4479bfb187b19ba1c8b1fa61226 (diff)
downloadcanory-473a08150b875112c522522e21fb542d3ec26736.tar.gz
canory-473a08150b875112c522522e21fb542d3ec26736.tar.bz2
canory-473a08150b875112c522522e21fb542d3ec26736.zip
themes/default/layouts: Handle image search errors
Namespace 404 image processing.
Diffstat (limited to 'themes/default/layouts/_default/_markup/render-image.html')
-rw-r--r--themes/default/layouts/_default/_markup/render-image.html14
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 d2a9ff7..fd83d75 100644
--- a/themes/default/layouts/_default/_markup/render-image.html
+++ b/themes/default/layouts/_default/_markup/render-image.html
@@ -1,23 +1,23 @@
{{- $source := $.Destination | safeURL -}}
-{{- $localPath := print "content/" $source -}}
+{{- $local := print "content/" $source -}}
{{- $remoteImage := resources.GetRemote $source -}}
{{- $width := "" -}}
{{- $height := "" -}}
{{- with $remoteImage -}}
{{- with .Err -}}
- {{- if fileExists $localPath -}}
- {{- $localImage := imageConfig $localPath -}}
- {{- with $localImage -}}
+ {{- if fileExists $local -}}
+ {{- $404image := imageConfig $local -}}
+ {{- with $404image -}}
{{- $width = .Width -}}
{{- $height = .Height -}}
{{- end -}}
{{ $source = print ("" | absURL) $source }}
{{- else -}}
{{- $source = print "/images/404.png" -}}
- {{- $localPath = print "static/" $source -}}
- {{- $localImage := imageConfig $localPath -}}
- {{- with $localImage -}}
+ {{- $local = print "static/" $source -}}
+ {{- $404image := imageConfig $local -}}
+ {{- with $404image -}}
{{- $width = .Width -}}
{{- $height = .Height -}}
{{- end -}}