Taxonomy term .Page.Description and .Page.Weight fail when title contains dash (-)

I’ve encountered an issue in Hugo where taxonomy term pages (_index.md under content/tags/<term>/) fail to expose .Page.Description and .Page.Weight when the title in the front matter contains a dash (-), even though .Page.Title still works.

Setup

  1. Hugo config (config.yaml):
taxonomies:
  tag: tags
  1. Content front matter example:
tags:
- Shift-Left Strategy
  1. Taxonomy term page:
content/tags/shift-left-strategy/_index.md

With front matter:

---
title: Shift-Left Strategy
description: A Shift-Left Strategy brings testing, security, and compliance earlier...
weight: 175
---

Sample template code

Here’s the template code used to render the taxonomy terms:

{{ $tags := slice }}
{{ range $name, $pages := .Site.Taxonomies.tags }}
  {{ $count := len (where $pages "Draft" "!=" true) }}
  {{ $tags = $tags | append (dict "name" $name "count" $count "pages" $pages "page" .Page) }}
{{ end }}

{{ $sorted := sort $tags "page.Weight" "asc" }}
{{ range first 20 $sorted }}
  <div class="d-flex align-items-center">
    <span class="text-truncate d-inline-block" style="max-width: 100%;" title="{{ .name }}">
      <a href="{{ .page.Permalink }}" title="{{ .page.Title }} - {{ .page.Description }}">{{ .page.Title }}</a>
    </span>
    <span class="ms-1">({{ .count }}){{- if ne hugo.Environment "production" }}[W:{{ .page.Weight }}]{{ end }}</span>
  </div>
{{ end }}

What works

  • .Page.Title outputs correctly as Shift-Left Strategy.
  • The taxonomy page renders at /tags/shift-left-strategy/.
  • .Page.Description and .Page.Weight work correctly on all other tags (for example, Product Managementproduct-management).

What fails

For the specific taxonomy term Shift-Left Strategy, .Page.Description and .Page.Weight are empty.
Even .Page.Params.description and .Page.Params.weight are empty.
The template outputs only the title; description and weight are missing.

How I resolved it

Changing the front matter to:

title: Shift Left Strategy
slug: shift-left-strategy

fixed the issue:

  • .Page.Description and .Page.Weight became available.
  • The URL stayed correct at /tags/shift-left-strategy/.

Expected behavior

Hugo should correctly surface description and weight from _index.md to .Page on taxonomy term pages, even if the title contains a dash (-).

Environment

  • Hugo version: [insert your Hugo version here, e.g., 0.124.1]
  • Build environment: [insert OS or deployment environment, e.g., macOS, Windows, Netlify]

Reproduction steps

  1. Define a taxonomy tags in config.yaml.
  2. Add tags: ["Shift-Left Strategy"] to content pages.
  3. Create _index.md under content/tags/shift-left-strategy/ with title: Shift-Left Strategy, description, and weight.
  4. Render the taxonomy template using the sample code above.
  5. Observe that .Page.Description and .Page.Weight are empty.

Notes

This issue does not occur for tags like Product Managementproduct-management, only for tags with dashes in the title.