How to get permalink of Taxonomies in templates?

Apologies for reviving this thread but by looking at your post I realized I can point to specific taxonomy pages using relref from inside my markdown content. I think it’s a useful feature that is missing from the Links and cross references | Hugo page.

E.g., link to specific tag {{< relref "tags/some-tag" >}} or taxonomy {{< relref "categories/some-category" >}}.

1 Like

You could do something like this…

{{ $categories := .Params.categories }}
{{ $all_categories := .Site.Taxonomies.categories }}
{{ with $categories }}
	{{- range $all_categories -}}
		{{ if in $categories .Page.Title }}
		<a href="{{- .Page.Permalink -}}">{{ .Page.Title }}</a>
		{{ end }}
	{{- end }}
{{ end }}