Skip to content

Commit 9ad4917

Browse files
feat(articles): "About the Author" section sourced from profiles (#29)
## What Adds an **About the Author** section to the bottom of article and podcast pages, sourced from the author's profile (the taxonomy term content file introduced in #27). > **Stacked on #27** (`feat/author-profiles`). Review/merge that first; this PR's base is `feat/author-profiles`, so the diff here is just the article section. ## Behavior - For each author credited in `authors:` who has **opted into a profile**, renders a card with avatar, preferred name, tagline, bio, social links, and a "View profile" link. - Articles whose authors have **no profile** are unchanged — no empty section. - Co-authored posts show a card per enriched author (heading pluralizes); un-enriched co-authors are simply omitted. - Reuses the `author-avatar` and `author-links` partials from #27. ## Cleanup Replaces the legacy per-article `author_bio` front-matter block — which **0 articles** used and which rendered a generic placeholder icon — with the profile-sourced partial. ## Testing - `hugo` builds clean. - Verified on a podcast episode crediting an enriched author (Gilbert Sanchez): the section renders with the Gravatar, tagline, bio, Mastodon/LinkedIn icons, and profile link. - Verified an article by an un-enriched author renders **no** About section. - Verified an episode that only name-drops an author in the title (not in `authors:`) gets no section. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 360b03f commit 9ad4917

2 files changed

Lines changed: 39 additions & 16 deletions

File tree

themes/powershell-community/layouts/_default/single.html

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,8 @@ <h3 class="text-lg font-semibold text-gray-900 mb-3">Tags</h3>
118118
</div>
119119
{{ end }}
120120

121-
<!-- Author Bio (if available) -->
122-
{{ with .Params.author_bio }}
123-
<div class="mt-6 pt-6 border-t border-gray-200">
124-
<div class="bg-gray-50 rounded-xl p-6">
125-
<div class="flex items-start space-x-4">
126-
<div class="w-16 h-16 bg-blue-600 rounded-full flex items-center justify-center">
127-
<i class="fas fa-user text-white text-xl"></i>
128-
</div>
129-
<div class="flex-1">
130-
<h3 class="text-lg font-semibold text-gray-900 mb-2">About <a href="{{ "/authors/" | relURL }}{{ $.Params.author | urlize }}/" class="hover:text-blue-600 transition-colors duration-200">{{ $.Params.author }}</a></h3>
131-
<p class="text-gray-600">{{ . }}</p>
132-
</div>
133-
</div>
134-
</div>
135-
</div>
136-
{{ end }}
121+
<!-- About the Author (sourced from author profiles) -->
122+
{{ partial "article-author-about.html" . }}
137123

138124
<!-- Related Posts -->
139125
{{ $related := .Site.RegularPages.Related . | first 3 }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{- /*
2+
"About the Author" section for article/single pages, sourced from each credited
3+
author's profile (taxonomy term content file). Renders only for authors who have
4+
opted into a profile, so articles by un-enriched authors are unchanged.
5+
*/ -}}
6+
{{- $enriched := slice -}}
7+
{{- with .GetTerms "authors" -}}
8+
{{- range . -}}
9+
{{- if .File -}}{{- $enriched = $enriched | append . -}}{{- end -}}
10+
{{- end -}}
11+
{{- end -}}
12+
{{- with $enriched -}}
13+
<div class="mt-8 pt-6 border-t border-gray-200">
14+
<h3 class="text-lg font-semibold text-gray-900 mb-4">About the Author{{ if gt (len .) 1 }}s{{ end }}</h3>
15+
<div class="space-y-4">
16+
{{- range . -}}
17+
{{- $display := .Title -}}{{- with .Params.preferred_name -}}{{- $display = . -}}{{- end -}}
18+
<div class="bg-gray-50 rounded-xl p-6">
19+
<div class="flex items-start gap-4">
20+
{{ partial "author-avatar.html" (dict "page" . "name" .Title "size" 96 "class" "w-16 h-16 rounded-full object-cover ring-2 ring-blue-100 shrink-0") }}
21+
<div class="flex-1 min-w-0">
22+
<h4 class="text-lg font-semibold text-gray-900">
23+
<a href="{{ .RelPermalink }}" class="hover:text-blue-600 transition-colors duration-200">{{ $display }}</a>
24+
</h4>
25+
{{ with .Params.tagline }}<p class="text-sm text-gray-500 mb-2">{{ . }}</p>{{ end }}
26+
{{ with .Content }}<div class="prose prose-sm max-w-none text-gray-600">{{ . }}</div>{{ end }}
27+
{{ partial "author-links.html" (dict "page" . "class" "flex gap-4 text-lg mt-3") }}
28+
<a href="{{ .RelPermalink }}" class="inline-flex items-center text-sm font-medium text-blue-600 hover:text-blue-700 mt-3">
29+
View profile<i class="fas fa-arrow-right ml-2"></i>
30+
</a>
31+
</div>
32+
</div>
33+
</div>
34+
{{- end -}}
35+
</div>
36+
</div>
37+
{{- end -}}

0 commit comments

Comments
 (0)