diff options
author | tdro <tdro@noreply.example.com> | 2023-05-10 19:18:18 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-05-10 19:33:02 -0400 |
commit | 019f938f2394adca667b11a7640377053547b70e (patch) | |
tree | 0a58fe3854bc66914c48fecd6175947340b88b09 /themes | |
parent | eadbad7563dfa571127e962d343726d6eec469ae (diff) | |
download | canory-019f938f2394adca667b11a7640377053547b70e.tar.gz canory-019f938f2394adca667b11a7640377053547b70e.tar.bz2 canory-019f938f2394adca667b11a7640377053547b70e.zip |
themes/default/layouts/partials/author-card: Guard empty metadata
More bug squashing under certain conditions
Diffstat (limited to 'themes')
-rw-r--r-- | themes/default/layouts/partials/author-card.html | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/themes/default/layouts/partials/author-card.html b/themes/default/layouts/partials/author-card.html index 61c403a..0f7945e 100644 --- a/themes/default/layouts/partials/author-card.html +++ b/themes/default/layouts/partials/author-card.html @@ -17,9 +17,11 @@ {{- $sourceset = print "/" (partial "function-paths.html").media "/" .Data.user "/" .Data.user "-profile.webp" -}} {{- with $metadata := resources.Get $metadata -}} - {{- $metadata = $metadata.Content | transform.Unmarshal -}} - {{- $width = $metadata.picture.profileWidth -}} - {{- $height = $metadata.picture.profileHeight -}} + {{- with $content := $metadata.Content -}} + {{- $metadata = $content | transform.Unmarshal -}} + {{- $width = $metadata.picture.profileWidth -}} + {{- $height = $metadata.picture.profileHeight -}} + {{- end -}} {{- end -}} {{- if or |