aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/author-picture.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/partials/author-picture.html')
-rw-r--r--themes/default/layouts/partials/author-picture.html12
1 files changed, 7 insertions, 5 deletions
diff --git a/themes/default/layouts/partials/author-picture.html b/themes/default/layouts/partials/author-picture.html
index dbbfd69..01786e7 100644
--- a/themes/default/layouts/partials/author-picture.html
+++ b/themes/default/layouts/partials/author-picture.html
@@ -20,9 +20,11 @@
{{- $source = print "/" (partial "function-paths.html").media "/" $author.user "/" $author.user "-profile" (path.Ext $author.picture.profile) -}}
{{- $sourceset = print "/" (partial "function-paths.html").media "/" $author.user "/" $author.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 -}}
{{- else -}}
{{- $source = "/data/media/404.png" -}}
{{- $sourceset = "" -}}
@@ -35,13 +37,13 @@
{{- end -}}
{{- with $sourceset -}}
-<source srcset="{{ $sourceset }}" type="image/webp" />
+<source srcset="{{ print ("" | absURL) $sourceset }}" type="image/webp" />
{{- end -}}
<img
width="{{ $width }}"
height="{{ $height }}"
- src="{{ $source }}"
+ src="{{ print ("" | absURL) $source }}"
alt="{{ $alternate }}"
/>
{{- /* This comment removes trailing newlines and white spaces. */ -}}