Skip to content

Commit f187433

Browse files
HeyItsGilbertclaude
andcommitted
feat(articles): add "About the Author" section sourced from profiles
Render a rich author card at the bottom of article/podcast pages for each credited author who has opted into a profile — avatar, preferred name, tagline, bio, social links, and a link through to the full profile. Articles by un-enriched authors are unchanged. Replaces the unused per-article `author_bio` block (0 articles used it) with the profile-sourced partial, reusing author-avatar and author-links. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 360b03f commit f187433

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)