fix: restore tags page tag cloud and normalize raspberry-pi tags#44
fix: restore tags page tag cloud and normalize raspberry-pi tags#44
Conversation
## What Added taxonomy-specific rendering to the list partial override so taxonomy pages (like /tags/) display as a tag cloud with counts instead of a dated post list. Also consolidated the "raspberry pi", "raspberrypi", and "raspberry pi" tag variants across all four Raspberry Pi Kubernetes Cluster posts into a single "raspberry-pi" tag. ## Why The hugo-coder theme update merged the taxonomy template into the generic list partial, causing the tags page to render as a post list instead of its original tag cloud format. The inconsistent tag naming also created duplicate tag entries on the tags page. ## Notes - The list.html partial now branches on `.Kind "taxonomy"` — any future taxonomy pages will also get the tag cloud format rather than the dated list format - The tag URL will change from `/tags/raspberry-pi/` consolidating what were previously separate pages for each variant Signed-off-by: jmeridth <jmeridth@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR restores the Hugo taxonomy list rendering so /tags/ (and other taxonomy list pages) display a term “cloud” with counts, and it normalizes Raspberry Pi tag variants across the Kubernetes cluster posts into a single raspberry-pi tag.
Changes:
- Add
.Kind == "taxonomy"branching in thelist.htmlpartial to render taxonomy term lists with counts. - Consolidate Raspberry Pi tag variants into
raspberry-piacross 4 posts.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
layouts/partials/list.html |
Adds taxonomy-specific rendering to show term list + counts instead of post list. |
content/posts/2018-04-07-raspberry-pi-kubernetes-cluster-part-1.md |
Normalizes tag to raspberry-pi. |
content/posts/2018-05-02-raspberry-pi-kubernetes-cluster-part-2.md |
Normalizes tag to raspberry-pi. |
content/posts/2018-12-24-raspberry-pi-kubernetes-cluster-part-3.md |
Normalizes tag to raspberry-pi. |
content/posts/2018-12-28-raspberry-pi-kubernetes-cluster-part-4.md |
Normalizes tag to raspberry-pi. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {{ $type := .Type }} | ||
| {{ range $key, $value := .Data.Terms.Alphabetical }} | ||
| {{ $name := .Name }} | ||
| {{ $count := .Count }} | ||
| {{ with $.Site.GetPage (printf "/%s/%s" $type $name) }} | ||
| <li> | ||
| <span class="taxonomy-element"> | ||
| <a href="{{ .Permalink }}">{{ .Name }}</a> |
There was a problem hiding this comment.
In the taxonomy branch, links are resolved via $.Site.GetPage (printf "/%s/%s" $type $name), where $name comes from .Name. This can drop terms when the displayed name differs from the URLized term (e.g., spaces/uppercase/special chars), and it also does an extra lookup per term. Prefer using the term page that is already available from .Data.Terms.Alphabetical (e.g., the entry’s .Page/permalink), or at minimum URLize $name before building the path.
| {{ $type := .Type }} | |
| {{ range $key, $value := .Data.Terms.Alphabetical }} | |
| {{ $name := .Name }} | |
| {{ $count := .Count }} | |
| {{ with $.Site.GetPage (printf "/%s/%s" $type $name) }} | |
| <li> | |
| <span class="taxonomy-element"> | |
| <a href="{{ .Permalink }}">{{ .Name }}</a> | |
| {{ range $key, $value := .Data.Terms.Alphabetical }} | |
| {{ $termPage := .Page }} | |
| {{ $count := .Count }} | |
| {{ with $termPage }} | |
| <li> | |
| <span class="taxonomy-element"> | |
| <a href="{{ .Permalink }}">{{ .Title }}</a> |
| {{ .Content }} | ||
| <ul> | ||
| {{ $type := .Type }} | ||
| {{ range $key, $value := .Data.Terms.Alphabetical }} |
There was a problem hiding this comment.
range $key, $value := .Data.Terms.Alphabetical declares $key/$value but the template uses the implicit dot (.) instead; consider simplifying to range .Data.Terms.Alphabetical (or consistently use $value) to avoid unused variables and make the intent clearer.
| {{ range $key, $value := .Data.Terms.Alphabetical }} | |
| {{ range .Data.Terms.Alphabetical }} |
| - kubernetes | ||
| - raspberry pi | ||
| - raspberry-pi |
There was a problem hiding this comment.
PR description note says the tag URL will change "from /tags/raspberry-pi/", but this change is consolidating variants to the raspberry-pi term. Consider updating the description to avoid implying the canonical URL is moving away from /tags/raspberry-pi/.
What
Added taxonomy-specific rendering to the list partial override so taxonomy pages (like /tags/) display as a tag cloud with counts instead of a dated post list. Also consolidated the "raspberry pi", "raspberrypi", and "raspberry pi" tag variants across all four Raspberry Pi Kubernetes Cluster posts into a single "raspberry-pi" tag.
Why
The hugo-coder theme update merged the taxonomy template into the generic list partial, causing the tags page to render as a post list instead of its original tag cloud format. The inconsistent tag naming also created duplicate tag entries on the tags page.
Notes
.Kind "taxonomy"— any future taxonomy pages will also get the tag cloud format rather than the dated list format/tags/raspberry-pi/consolidating what were previously separate pages for each variant