Hi there,
i am new to gohugo and i’m creating my own template. Having some issues in the Category List.
I’m getting all Categories available in my posts. But i am not able to filter for duplicates.
<div class="mb40">
<h4 class="sidebar-title">Kategorien</h4>
<ul class="list-unstyled categories">
{{ range .Pages }}
<li><a href="/{{ .Params.Categories }}">{{ .Params.Categories }}</a></li>
{{ end }}
</ul>
</div><!--/col-->
I tried to solve this by using GroupByParam “Categories” but then i get no output. (My Category is not in an taxonomy. I used jekyll exporter to get all my posts out of wordpress).
<div class="mb40">
<h4 class="sidebar-title">Kategorien</h4>
<ul class="list-unstyled categories">
{{ range .Pages }}
{{ range .Pages.GroupByParam "Categories" }}
{{ range .Pages }}
<li><a href="/{{ .Key }}">{{ .Title }}</a></li>
{{ end }}
{{ end }}
{{ end }}
</ul>
</div><!--/col-->