diff options
author | tdro <tdro@noreply.example.com> | 2022-06-24 03:36:33 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-06-24 03:36:33 -0400 |
commit | d8835677c49292d9186003df777ece0670ba742e (patch) | |
tree | 340cc61d2cddf0c349e970cfa68ed6b7fd0948b3 /themes/default/layouts/partials/author-picture.html | |
parent | f140c37f83753d620bdf3499843e3d11ca4a131d (diff) | |
download | canory-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-picture.html')
-rw-r--r-- | themes/default/layouts/partials/author-picture.html | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/themes/default/layouts/partials/author-picture.html b/themes/default/layouts/partials/author-picture.html index 9499185..c269efc 100644 --- a/themes/default/layouts/partials/author-picture.html +++ b/themes/default/layouts/partials/author-picture.html @@ -1,14 +1,14 @@ {{- $file := "/profile/picture.png" -}} {{- $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 := "160x160" -}} +{{- $author := partial "author-user.html" . }} {{- with .Params.feed -}} {{- else -}} {{- with $image -}} - {{- $image = .Content | resources.FromString (print "/data/static/images/" ($image | urlize)) -}} + {{- $image = .Content | resources.FromString (print (partial "function-paths-media.html") "/" $author "/" (path.Base .)) -}} <source srcset="{{- ($image.Fit (print $dimensions " webp")).RelPermalink -}}" type="image/webp" /> {{- end -}} {{ end }} @@ -23,7 +23,7 @@ {{ else }} {{ if fileExists $path }} {{- with $image -}} - {{- $image = (.Content | resources.FromString (print "/data/static/images/" ($image | urlize))).Fit $dimensions -}} + {{- $image = (.Content | resources.FromString (print (partial "function-paths-media.html") "/" $author "/" (path.Base .))).Fit $dimensions -}} width="{{ $image.Width }}" height="{{ $image.Height }}" src="{{ $image.RelPermalink }}" @@ -33,7 +33,7 @@ {{- else -}} width="{{ $404image.Width }}" height="{{ $404image.Height }}" - src="{{ $404origin }}" + src="{{ $404image.RelPermalink }}" {{- end }} alt="{{ partial "author-name.html" . }}" {{ end -}} |