-{{- /*
-For a given taxonomy, renders a list of terms assigned to the page.
-
-@context {page} page The current page.
-@context {string} taxonomy The taxonomy.
-
-@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
-*/}}
-
-{{- $page := .page }}
-{{- $taxonomy := .taxonomy }}
-
-{{- with $page.GetTerms $taxonomy }}
- {{- $label := (index . 0).Parent.LinkTitle }}
- <div>
- <div>{{ $label }}:</div>
- <ul>
- {{- range . }}
- <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
- {{- end }}
- </ul>
- </div>
+{{- $page := .Page }}
+{{- range .Page.Site.Taxonomies }}
+{{- $taxonomy := . }}
+{{- $terms := $page.GetTerms .Page.Data.Plural }}
+{{- if gt $terms.Len 0 }}
+<h3><a href="{{ .Page.RelPermalink }}">{{ .Page.LinkTitle }}</a></h3>
+<ul>
+ {{- range $terms }}
+ <li><a href="{{ .Page.RelPermalink }}">{{ .Page.LinkTitle }}</a> <span>{{ $taxonomy.Count .Page.Data.Term }}</span></li>
+ {{- end }}
+</ul>
+{{- end }}
{{- end }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
{{ .Content }}
- {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
+ {{ partial "terms.html" . }}
{{ end }}