Skip to content

Commit 4484d83

Browse files
Community page lists its sub-pages (#14)
## Problem The `/community` page rendered as an empty stub — just the header, no body. The default `list.html` layout ranges over child **content** pages, but the community section has none. Its sub-pages (Learning, Calendar, Authors, Forums, Discord Archive) only existed in the nav dropdown via the `community` menu. ## Change - Add `themes/powershell-community/layouts/community/list.html`, a section-specific layout that renders the `community` menu entries as a card grid (keeping the section's intro text and header styling). - Enrich the `community` menu entries in `hugo.yaml` with `icon` and `description` params (and `external: true` on Forums so it opens in a new tab). Because the page is driven off `.Site.Menus.community`, future sub-pages only need a menu entry to show up in both the nav dropdown and the page body — they stay in sync automatically. ## Testing - `hugo` builds clean (no new warnings). - Verified the rendered `/community/index.html` contains all five cards with correct icons and the external Forums link. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e590650 commit 4484d83

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

hugo.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,34 @@ menu:
5555
- name: "Learning"
5656
url: "/learning/"
5757
weight: 10
58+
params:
59+
icon: "fas fa-graduation-cap"
60+
description: "Guides, tutorials, and resources to grow your PowerShell skills."
5861
- name: "Calendar"
5962
url: "/calendar/"
6063
weight: 20
64+
params:
65+
icon: "fas fa-calendar-days"
66+
description: "Upcoming user group meetings, webinars, and community events."
6167
- name: "Authors"
6268
url: "/authors/"
6369
weight: 30
70+
params:
71+
icon: "fas fa-pen-nib"
72+
description: "Meet the community members writing articles and sharing knowledge."
6473
- name: "Forums"
6574
url: "https://forums.powershell.org"
6675
weight: 40
76+
params:
77+
icon: "fas fa-comments"
78+
description: "Ask questions and discuss PowerShell with the wider community."
79+
external: true
6780
- name: "Discord Archive"
6881
url: "/discord/"
6982
weight: 50
83+
params:
84+
icon: "fab fa-discord"
85+
description: "Searchable archive of conversations from our Discord server."
7086

7187
# Site parameters
7288
params:
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{{ define "main" }}
2+
3+
<!-- Page Header -->
4+
<section class="powershell-blue py-10">
5+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center text-white">
6+
<h1 class="text-4xl lg:text-5xl font-bold mb-2">{{ .Title }}</h1>
7+
{{ if .Params.description }}
8+
<p class="text-xl opacity-90 max-w-3xl mx-auto">{{ .Params.description }}</p>
9+
{{ end }}
10+
</div>
11+
</section>
12+
13+
<!-- Content Section -->
14+
<section class="py-10 bg-gray-50">
15+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
16+
{{ with .Content }}
17+
<div class="prose prose-lg max-w-3xl mx-auto text-center mb-10">{{ . }}</div>
18+
{{ end }}
19+
20+
<!-- Sub-page Grid -->
21+
<div class="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
22+
{{ range .Site.Menus.community }}
23+
<a href="{{ .URL }}"
24+
{{ if .Params.external }}target="_blank" rel="noopener"{{ end }}
25+
class="group block bg-white rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300 p-6">
26+
<div class="flex items-center mb-3">
27+
<div class="flex items-center justify-center w-12 h-12 rounded-lg bg-blue-100 text-blue-600 mr-4">
28+
<i class="{{ with .Params.icon }}{{ . }}{{ else }}fas fa-link{{ end }} text-xl"></i>
29+
</div>
30+
<h2 class="text-xl font-bold text-gray-900 group-hover:text-blue-600 transition-colors duration-200">
31+
{{ .Name }}
32+
{{ if .Params.external }}<i class="fas fa-arrow-up-right-from-square text-xs text-gray-400 ml-1"></i>{{ end }}
33+
</h2>
34+
</div>
35+
{{ with .Params.description }}
36+
<p class="text-gray-600">{{ . }}</p>
37+
{{ end }}
38+
</a>
39+
{{ end }}
40+
</div>
41+
</div>
42+
</section>
43+
44+
{{ end }}

0 commit comments

Comments
 (0)