{{ if isset .Site.Taxonomies "categories" }}
{{ if not (eq (len .Site.Taxonomies.categories) 0) }}
    <h3>
    {{ $current_path := .RelPermalink}}
    {{ range $name, $items := .Site.Taxonomies.categories }}
        {{ $pagepath := $name | urlize | lower | printf "%s%s" "/categories/"}}
        
        {{ $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 }}
