speedtech-website/layouts/partials/widgets/categories.html

20 lines
583 B
HTML
Raw Normal View History

{{ if isset .Site.Taxonomies "categories" }}
{{ if not (eq (len .Site.Taxonomies.categories) 0) }}
2024-10-04 11:58:15 +02:00
<h3>
{{ $current_path := .RelPermalink}}
{{ range $name, $items := .Site.Taxonomies.categories }}
{{ $pagepath := $name | urlize | lower | printf "%s%s" "/categories/"}}
2024-10-04 11:58:15 +02:00
{{ $p := $.Site.GetPage $pagepath}}
{{ $path := $p.RelPermalink }}
{{ if eq $current_path $path }}
{{ $p.Title }}
{{ else }}
<a href="{{ $path }}">{{ $p.Title }}</a>
{{ end }}
{{ end }}
</h3>
{{ end }}
{{ end }}