Skip to content

Commit f3dfa0c

Browse files
committed
fix(author): show articles before podcast episodes, add section-aware styling
Author pages were dominated by podcast episodes (220+ for James Petty) which appeared before any written articles because they sort by date and are more recent. Podcast episodes were also rendered with article styling (blue icon, "Read Article" button), making interviews titled "with [Guest]" look like unrelated articles about other people. - Sort written articles first, podcast episodes after, using where/append - Render podcast episodes with purple podcast styling (matching list.html) - Show separate article and episode counts in the author summary card
1 parent 31904c7 commit f3dfa0c

1 file changed

Lines changed: 63 additions & 11 deletions

File tree

  • themes/powershell-community/layouts/taxonomy

themes/powershell-community/layouts/taxonomy/author.html

Lines changed: 63 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ <h1 class="text-4xl lg:text-5xl font-bold mb-2">{{ .Title }}</h1>
1616
<!-- Author Details & Articles -->
1717
<section class="py-10 bg-gray-50">
1818
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
19+
20+
{{ $articles := where .Pages "Section" "articles" }}
21+
{{ $podcasts := where .Pages "Section" "podcast" }}
22+
23+
<!-- Articles before podcast episodes so authored content appears first -->
24+
{{ $combined := $articles | append $podcasts }}
25+
1926
<!-- Author Summary -->
2027
<div class="bg-white rounded-xl shadow-lg p-6 mb-8">
2128
<div class="flex items-center mb-4">
@@ -24,18 +31,61 @@ <h1 class="text-4xl lg:text-5xl font-bold mb-2">{{ .Title }}</h1>
2431
</div>
2532
<div>
2633
<h2 class="text-3xl font-bold text-gray-900">{{ .Title }}</h2>
27-
<p class="text-gray-600">{{ .Pages | len }} article{{ if gt (.Pages | len) 1 }}s{{ end }} published</p>
34+
<p class="text-gray-600">
35+
{{ len $articles }} article{{ if ne (len $articles) 1 }}s{{ end }}
36+
{{ if $podcasts }}
37+
&nbsp;•&nbsp; {{ len $podcasts }} podcast episode{{ if ne (len $podcasts) 1 }}s{{ end }}
38+
{{ end }}
39+
</p>
2840
</div>
2941
</div>
3042
</div>
3143

32-
<!-- Articles Grid -->
44+
<!-- Content Grid -->
3345
<div class="grid gap-6 mb-8">
34-
{{ $paginator := .Paginate .Pages }}
46+
{{ $paginator := .Paginate $combined }}
3547
{{ range $paginator.Pages }}
36-
<article class="bg-white rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300 overflow-hidden article-card"
37-
data-title="{{ .Title | lower }}"
48+
<article class="bg-white rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300 overflow-hidden article-card"
49+
data-title="{{ .Title | lower }}"
3850
data-content="{{ .Summary | lower }}">
51+
52+
{{ if eq .Section "podcast" }}
53+
<!-- Podcast Episode Layout -->
54+
<div class="lg:flex">
55+
<div class="lg:w-1/3 p-6 lg:pr-0">
56+
<div class="aspect-square bg-gradient-to-br from-purple-400 to-purple-600 rounded-lg flex items-center justify-center">
57+
<i class="fas fa-podcast text-4xl text-white"></i>
58+
</div>
59+
</div>
60+
<div class="lg:w-2/3 p-6 lg:pl-8">
61+
<div class="flex items-center text-purple-600 text-sm font-medium mb-3">
62+
<i class="fas fa-podcast mr-2"></i>
63+
<span class="mr-2">Podcast Episode</span>
64+
<span class="mx-2"></span>
65+
<time>{{ .Date.Format "January 2, 2006" }}</time>
66+
{{ if .ReadingTime }}
67+
<span class="mx-2"></span>
68+
<i class="fas fa-clock mr-1"></i>
69+
<span>{{ .ReadingTime }} min</span>
70+
{{ end }}
71+
</div>
72+
<h2 class="text-xl lg:text-2xl font-bold text-gray-900 mb-3">
73+
<a href="{{ .Permalink }}" class="hover:text-purple-600 transition-colors duration-200">
74+
{{ .Title }}
75+
</a>
76+
</h2>
77+
<p class="text-gray-600 mb-4 line-clamp-3">{{ .Summary }}</p>
78+
<div class="flex flex-wrap items-center gap-4">
79+
<a href="{{ .Permalink }}"
80+
class="inline-flex items-center bg-purple-600 text-white px-4 py-2 rounded-lg font-medium hover:bg-purple-700 transition-colors duration-200">
81+
<i class="fas fa-play mr-2"></i>Listen to Episode
82+
</a>
83+
</div>
84+
</div>
85+
</div>
86+
87+
{{ else }}
88+
<!-- Article Layout -->
3989
<div class="lg:flex">
4090
<div class="lg:w-1/3 p-6 lg:pr-0">
4191
<div class="aspect-square bg-gradient-to-br from-blue-400 to-blue-600 rounded-lg flex items-center justify-center">
@@ -59,7 +109,7 @@ <h2 class="text-xl lg:text-2xl font-bold text-gray-900 mb-3">
59109
</h2>
60110
<p class="text-gray-600 mb-4 line-clamp-3">{{ .Summary }}</p>
61111
<div class="flex flex-wrap items-center gap-4">
62-
<a href="{{ .Permalink }}"
112+
<a href="{{ .Permalink }}"
63113
class="inline-flex items-center bg-blue-600 text-white px-4 py-2 rounded-lg font-medium hover:bg-blue-700 transition-colors duration-200">
64114
<i class="fas fa-book mr-2"></i>Read Article
65115
</a>
@@ -75,6 +125,8 @@ <h2 class="text-xl lg:text-2xl font-bold text-gray-900 mb-3">
75125
</div>
76126
</div>
77127
</div>
128+
{{ end }}
129+
78130
</article>
79131
{{ end }}
80132
</div>
@@ -84,27 +136,27 @@ <h2 class="text-xl lg:text-2xl font-bold text-gray-900 mb-3">
84136
<nav class="flex justify-center" aria-label="Pagination">
85137
<div class="flex items-center space-x-1">
86138
{{ if $paginator.HasPrev }}
87-
<a href="{{ $paginator.Prev.URL }}"
139+
<a href="{{ $paginator.Prev.URL }}"
88140
class="px-3 py-2 text-blue-600 hover:bg-blue-50 rounded-lg transition-colors duration-200">
89141
<i class="fas fa-chevron-left"></i>
90142
</a>
91143
{{ end }}
92-
144+
93145
{{ range $paginator.Pagers }}
94146
{{ if eq . $paginator }}
95147
<span class="px-3 py-2 bg-blue-600 text-white rounded-lg font-medium">
96148
{{ .PageNumber }}
97149
</span>
98150
{{ else }}
99-
<a href="{{ .URL }}"
151+
<a href="{{ .URL }}"
100152
class="px-3 py-2 text-blue-600 hover:bg-blue-50 rounded-lg transition-colors duration-200">
101153
{{ .PageNumber }}
102154
</a>
103155
{{ end }}
104156
{{ end }}
105-
157+
106158
{{ if $paginator.HasNext }}
107-
<a href="{{ $paginator.Next.URL }}"
159+
<a href="{{ $paginator.Next.URL }}"
108160
class="px-3 py-2 text-blue-600 hover:bg-blue-50 rounded-lg transition-colors duration-200">
109161
<i class="fas fa-chevron-right"></i>
110162
</a>

0 commit comments

Comments
 (0)