<div class="taxonomies">
  {{- if or .Params.categories .Params.tags -}}
  <ul class="tags">
    {{- if .Params.categories -}}
      {{- $categories := .GetTerms "categories" -}}
      {{- if gt (len $categories) 1 -}}
        {{- errorf "More than one category for %q" .Path -}}
      {{- end -}}

      {{- with index (.GetTerms "categories") 0 -}}
        <li class="category"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
      {{- end -}}
    {{- end -}}
  </ul>

    {{- if and .Params.categories .Params.tags -}}
      <div class="chevron noselect">⏵</div>
    {{- end -}}

  <ul class="tags">
    {{- if .Params.tags -}}
      {{- range .GetTerms "tags" -}}
        <li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
      {{- end -}}
    {{- end -}}
  </ul>
  {{- end -}}
</div>
