Hi all,
Apologies, this may be a very trivial question as I’m totally new to Hugo.
I have a section called “notes” with a landing page (“section.html”) displaying the categories of all pages within it, as follows:
Categories:
<ul class="posts">
{{ range $taxonomyname, $taxonomy := .Site.Taxonomies }}
{{ if eq "categories" $taxonomyname }}
{{ range $key, $value := $taxonomy }}
{{ if ge (where $value.Pages "Section" "notes") 1 }}
<div class="col-md-3 col-sm-6 col-xs-12">
<a href="/notes/custom_page_with_list_of_pages_in_this_section_with_category_key/{{ $key | urlize }}">{{ $key | humanize }} </a>
</div>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
As you can see, this code enumerates the categories for pages within it and creates a link for each one of them ("/notes/custom_page_with_list_of_pages_in_this_section_with_category_key…").
I would like each of these links to point to a list of all pages holding the linked category within this section. So that /notes/custom_page_with_list_of_pages_in_this_section_with_category_key/my_category lists all pages with category my_category under section notes . I don’t know in what file location would I place code so that Hugo loads it from a custom URL as exemplified above.
P.S.: This is similar to what Hugo categories taxonomy already does by default at /categories/my_category … but I want it for my “notes” section only.
Similar question: Taxonomies per section - #4 by Reddog"
Thanks in advance.