diff --git a/modules/blox/layouts/_partials/functions/get_author_profile.html b/modules/blox/layouts/_partials/functions/get_author_profile.html index 328fcb9d..6686204a 100644 --- a/modules/blox/layouts/_partials/functions/get_author_profile.html +++ b/modules/blox/layouts/_partials/functions/get_author_profile.html @@ -20,17 +20,22 @@ Output (dict): {{- $input := . -}} {{- $slug := "" -}} +{{- $rawTitle := "" -}} {{- $inputType := printf "%T" $input -}} {{- if (reflect.IsMap $input) -}} {{- $slug = index $input "slug" | default "" -}} + {{- with index $input "title" }}{{ $rawTitle = . }}{{ end -}} {{- else if eq $inputType "string" -}} {{- $slug = $input -}} + {{- $rawTitle = $input -}} {{- else -}} {{- $slug = printf "%v" $input -}} {{- end -}} +{{- $rawTitle = trim $rawTitle " " -}} + {{- $slug = $slug | urlize -}} {{- $data := index site.Data.authors $slug -}} @@ -59,8 +64,10 @@ Output (dict): {{- $title = $display -}} {{- else if $data.title -}} {{- $title = $data.title -}} +{{- else if $rawTitle -}} + {{- $title = $rawTitle -}} {{- else -}} - {{- $title = $slug | humanize -}} + {{- $title = $slug | humanize | title -}} {{- end -}} {{- $role := $data.role -}}