{{- $context := .Context -}} {{- if not .Params.taxonomy -}} {{- warnf "Taxonomy field is required" -}} {{- end -}} {{- $taxonomy := index $context.Site.Taxonomies .Params.taxonomy -}} {{- if not $taxonomy -}} {{- warnf "Taxonomy %s not found" .Params.taxonomy -}} {{- end -}} {{- $taxonomyPage := $taxonomy.Page -}} {{- $widgetTitle := .Params.title -}} {{- $limit := default 10 .Params.limit -}} {{- $icon := default .Params.taxonomy .Params.icon -}} {{- $showLink := default true .Params.showLink -}}
{{ partial "helper/icon" $icon }}

{{ if and $showLink $taxonomyPage }} {{ $widgetTitle }} {{ else }} {{ $widgetTitle }} {{ end }}

{{ range first $limit $taxonomy.ByCount }} {{ .Page.Title }} {{ end }}