{{ define "main" }} {{/* taxonomy.html — renders the terms overview for any palace taxonomy. Used for /tags/, /palace-rooms/, /characters/, /phases/, /session-types/, etc. Two views: Cloud — terms sized by post count (CSS font-size scale w1–w5) List — alphabetical, with count badge Pill color is inferred from .Data.Plural to match the pill system. Guard: if .Data.Terms is nil (e.g. term list pages falling through), render an empty state rather than panicking. */}} {{ $plural := .Data.Plural }} {{ $singular := .Data.Singular }} {{ $pillClass := "tag" }} {{ if eq $plural "palace_rooms" }}{{ $pillClass = "room" }} {{ else if eq $plural "characters" }}{{ $pillClass = "char" }} {{ else if eq $plural "phases" }}{{ $pillClass = "phase" }} {{ else if eq $plural "session_types" }}{{ $pillClass = "type" }} {{ end }}

{{ .Title }}

{{ with .Data.Terms }} {{/* .Data.Terms is a Taxonomy (map). Store it for both ByCount and Alphabetical. */}} {{ $byCount := .ByCount }} {{ $byAlpha := .Alphabetical }}

{{ len $byCount }} {{ $singular }}{{ if gt (len $byCount) 1 }}s{{ end }}

{{/* ── Cloud view ────────────────────────────────────────────────────── */}}
{{ $max := 1 }} {{ range $byCount }}{{ if gt .Count $max }}{{ $max = .Count }}{{ end }}{{ end }} {{ range $byCount }} {{ $weight := div (mul .Count 4) $max | add 1 }} {{ .Page.Title }} {{ .Count }} {{ end }}
{{/* ── Alphabetical list ───────────────────────────────────────────── */}}

All {{ $plural | humanize | title }}

    {{ range $byAlpha }}
  1. {{ .Page.Title }} {{ .Count }}
  2. {{ end }}
{{ else }}

No {{ $plural }} yet.

{{ end }}
{{ end }}