Skip to content

Commit

Permalink
allow to set image .Fill anchor for profile pictures
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmehl committed Sep 20, 2024
1 parent 018cf89 commit 6e5d789
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion themes/openrail/layouts/shortcodes/people/person.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
{{- with $data.img }}
{{- $img = path.Join "images/people" . }}
{{- end }}
{{- $img_resized := (resources.Get $img).Fill "300x300 Center" }}
{{/* See .Fill parameters: https://gohugo.io/methods/resource/fill/ */}}
{{- $img_fill_params := print "300x300 " (default "Center" .Params.img_anchor) }}
{{- $img_resized := (resources.Get $img).Fill $img_fill_params }}
<img src="{{ $img_resized.RelPermalink }}" alt="Picture of {{ $data.name }}">
<h5>{{ $data.name }}</h5>
{{ with $data.openrail_role -}}
Expand Down

0 comments on commit 6e5d789

Please sign in to comment.