2023-10-03 11:20:20 +00:00
|
|
|
{{- $page := .page }}
|
|
|
|
{{- $taxonomy := .taxonomy }}
|
|
|
|
{{- $class := .class }}
|
2023-10-03 20:49:49 +00:00
|
|
|
{{- $color := .color | default "" }}
|
|
|
|
{{- $style := .style | default "" }}
|
|
|
|
{{- if and (not $style) (eq (len $style) 0) }}
|
|
|
|
{{- $color = .color | default "var(--INTERNAL-TAG-BG-color)" }}
|
|
|
|
{{- end }}
|
2023-10-03 11:20:20 +00:00
|
|
|
{{- $icon := .icon | default "" }}
|
|
|
|
{{- $icon = trim $icon " " }}
|
|
|
|
{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
|
|
|
|
{{- $icon = printf "fa-fw fas fa-%s" $icon }}
|
|
|
|
{{- end }}
|
|
|
|
{{- $taxonomy_page := $page.Site.GetPage $taxonomy }}
|
|
|
|
{{- $terms := slice | append (index $page.Params $taxonomy) }}
|
2023-11-01 21:19:39 +00:00
|
|
|
{{- $term_pages := slice }}
|
|
|
|
{{- range $terms }}
|
2023-10-03 11:20:20 +00:00
|
|
|
{{- $term := trim . " " }}
|
|
|
|
{{- if not $term }}
|
|
|
|
{{- continue }}
|
|
|
|
{{- end }}
|
|
|
|
{{- $term_key := ($term | plainify | anchorize) }}
|
|
|
|
{{- with $page.Site.GetPage (printf "%s/%s" $taxonomy $term_key) }}
|
2023-11-28 21:45:38 +00:00
|
|
|
{{- $term_pages = $term_pages | append (dict "Title" (default (humanize .Data.Term | strings.Title) .Title) "Term" . )}}
|
2023-11-01 21:19:39 +00:00
|
|
|
{{- else }}
|
|
|
|
{{- $term_key = ($term | urlize) }}
|
|
|
|
{{- with $page.Site.GetPage (printf "%s/%s" $taxonomy $term_key) }}
|
2023-11-28 21:45:38 +00:00
|
|
|
{{- $term_pages = $term_pages | append (dict "Title" (default (humanize .Data.Term | strings.Title) .Title) "Term" . )}}
|
2023-11-01 21:19:39 +00:00
|
|
|
{{- end }}
|
2023-10-03 11:20:20 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2023-11-03 21:50:02 +00:00
|
|
|
{{- $taxonomy_title := default (default $taxonomy_page.Data.Plural (i18n $taxonomy_page.Data.Plural)) $taxonomy_page.Title }}
|
2023-10-03 11:20:20 +00:00
|
|
|
{{- with $term_pages }}
|
2023-11-03 21:50:02 +00:00
|
|
|
<div class=" taxonomy-{{ $taxonomy }} term-list cstyle {{ $style }} {{ $class }}" title="{{ $taxonomy_title }}"{{ if $color }}{{ printf " style=\"--VARIABLE-TAGS-BG-color: %s;\"" $color | safeHTMLAttr }}{{ end }}>
|
2023-10-03 11:20:20 +00:00
|
|
|
{{- if $icon }}
|
2023-10-03 19:27:45 +00:00
|
|
|
<i class="{{ $icon }}"></i>
|
2023-10-03 11:20:20 +00:00
|
|
|
{{- end }}
|
|
|
|
<ul>
|
2023-11-01 21:19:39 +00:00
|
|
|
{{- range sort . ".Title" }}
|
|
|
|
{{- $to := .Term }}
|
|
|
|
<li><a class="term-link" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" $to) }}">{{ .Title }}</a></li>
|
2023-10-03 11:20:20 +00:00
|
|
|
{{- end }}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
{{- end }}
|