terms.html 554 B

1234567891011121314151617181920212223
  1. {{- /*
  2. For a given taxonomy, renders a list of terms assigned to the page.
  3. @context {page} page The current page.
  4. @context {string} taxonomy The taxonomy.
  5. @example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
  6. */}}
  7. {{- $page := .page }}
  8. {{- $taxonomy := .taxonomy }}
  9. {{- with $page.GetTerms $taxonomy }}
  10. {{- $label := (index . 0).Parent.LinkTitle }}
  11. <div>
  12. <div>{{ $label }}:</div>
  13. <ul>
  14. {{- range . }}
  15. <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
  16. {{- end }}
  17. </ul>
  18. </div>
  19. {{- end }}