+{{- /*
+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>
+{{- end }}
+ <ul class="terms-tags">
+ {{- $type := .Type }}
+ {{- range $key, $value := .Data.Terms.Alphabetical }}
+ {{- $name := .Name }}
+ {{- $count := .Count }}
+ {{- with site.GetPage (printf "/%s/%s" $type $name) }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Name }} <sup><strong><sup>{{ $count }}</sup></strong></sup> </a>
+ </li>
+ {{- end }}
+ {{- end }}
+ </ul>
+
{{- define "custom_css" }}
<style>
.terms-tags li {
}
</style>
{{- end }}
-{{- define "main" }}
-
-{{- if .Title }}
-<header class="page-header">
- <h1>{{ .Title }}</h1>
- {{- if .Description }}
- <div class="post-description">
- {{ .Description }}
- </div>
- {{- end }}
-</header>
-{{- end }}
-
-<ul class="terms-tags">
- {{- $type := .Type }}
- {{- range $key, $value := .Data.Terms.Alphabetical }}
- {{- $name := .Name }}
- {{- $count := .Count }}
- {{- with site.GetPage (printf "/%s/%s" $type $name) }}
- <li>
- <a href="{{ .Permalink }}">{{ .Name }} <sup><strong><sup>{{ $count }}</sup></strong></sup> </a>
- </li>
- {{- end }}
- {{- end }}
-</ul>
-
-{{- end }}{{/* end main */ -}}