aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/author-header.html
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-06-24 03:36:33 -0400
committertdro <tdro@noreply.example.com>2022-06-24 03:36:33 -0400
commitd8835677c49292d9186003df777ece0670ba742e (patch)
tree340cc61d2cddf0c349e970cfa68ed6b7fd0948b3 /themes/default/layouts/partials/author-header.html
parentf140c37f83753d620bdf3499843e3d11ca4a131d (diff)
downloadcanory-d8835677c49292d9186003df777ece0670ba742e.tar.gz
canory-d8835677c49292d9186003df777ece0670ba742e.tar.bz2
canory-d8835677c49292d9186003df777ece0670ba742e.zip
themes/default: static/images -> data/media
Add media path. Translate static images to data media.
Diffstat (limited to 'themes/default/layouts/partials/author-header.html')
-rw-r--r--themes/default/layouts/partials/author-header.html10
1 files changed, 5 insertions, 5 deletions
diff --git a/themes/default/layouts/partials/author-header.html b/themes/default/layouts/partials/author-header.html
index 0590358..9babf1d 100644
--- a/themes/default/layouts/partials/author-header.html
+++ b/themes/default/layouts/partials/author-header.html
@@ -1,19 +1,19 @@
{{- $file := "/profile/header.jpg" -}}
{{- $path := print "public/" (partial "author-media-path.html" .) $file -}}
{{- $image := resources.Get $path -}}
-{{- $404origin := print "/images/404.png" -}}
-{{- $404image := imageConfig (print "static/" $404origin) -}}
+{{- $404image := resources.Get "data/media/404.png" -}}
{{- $dimensions := "x600" -}}
+{{- $author := partial "author-user.html" . }}
{{- with $image -}}
- {{- $image = .Content | resources.FromString (print "/data/static/images/" (. | urlize)) -}}
+ {{- $image = .Content | resources.FromString (print (partial "function-paths-media.html") "/" $author "/" (path.Base .)) -}}
<source srcset="{{- ($image.Resize (print $dimensions " webp")).RelPermalink -}}" type="image/webp" />
{{- end -}}
<img
{{ if fileExists $path }}
{{- with $image -}}
- {{- $image = (.Content | resources.FromString (print "/data/static/images/" ($image | urlize))).Resize $dimensions -}}
+ {{- $image = (.Content | resources.FromString (print (partial "function-paths-media.html") "/" $author "/" (path.Base .))).Resize $dimensions -}}
width="{{ $image.Width }}"
height="{{ $image.Height }}"
src="{{ $image.RelPermalink }}"
@@ -23,7 +23,7 @@
{{- else -}}
width="{{ $404image.Width }}"
height="{{ $404image.Height }}"
- src="{{ $404origin }}"
+ src="{{ $404image.RelPermalink }}"
{{- end }}
alt="{{ partial "author-name.html" . }}"
/>