From 85307a809791396a9902fe57e2182b9f5daa9bcf Mon Sep 17 00:00:00 2001 From: George Cushen Date: Tue, 6 Jan 2026 20:13:34 +0000 Subject: [PATCH] feat(authors): preserve author casing when profiles are missing - retain raw front-matter author strings as display names when no profile data is present - title-case humanized slug only as last-resort fallback to avoid lowercase surnames - reduce need for author profile files while keeping names correctly capitalized Fixes https://discord.com/channels/722225264733716590/1457522006462435541 --- .../layouts/_partials/functions/get_author_profile.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -}}