aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/author-card.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/partials/author-card.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/partials/author-card.html')
-rw-r--r--themes/default/layouts/partials/author-card.html11
1 files changed, 10 insertions, 1 deletions
diff --git a/themes/default/layouts/partials/author-card.html b/themes/default/layouts/partials/author-card.html
index e2a2623..23e007a 100644
--- a/themes/default/layouts/partials/author-card.html
+++ b/themes/default/layouts/partials/author-card.html
@@ -5,7 +5,16 @@
<figure>
<a title="{{ .Data.name }}" href="{{ "" | absURL }}/{{ .Data.user }}">
<picture>
- <img alt="{{ .Data.name }}" src="{{ "" | absURL }}/{{ .Data.user }}/media/profile/picture.png" />
+ <img
+ alt="{{ .Data.name }}"
+ {{- if fileExists (print "content/" .Data.user "/media/profile/picture.png") }}
+ src="{{ "" | absURL }}/{{ .Data.user }}/media/profile/picture.png"
+ {{ else }}
+ {{- $404origin := print "/images/404.png" }}
+ {{- $404image := imageConfig (print "static/" $404origin) }}
+ src="{{ $404origin }}"
+ {{- end -}}
+ />
</picture>
</a>
</figure>