Create pages, intersecting nested sections with taxonomy

I am attempting to add a business directory (of sorts) to my website.

I have a post for each business listing and they are placed in nested sections (by city)

directory > manchester
directory > birmingham

In each post, the services are listed in the front matter.

services: [“swimming lessons”,“personal training”,“boot camps”]

What I am looking to achieve:
I would like to create a page for each service by city, listing all businesses which offer that service.

I would also like to list the available services on each city page, linking to these [city by service] pages

I understand some basic principles of hugo, but I am still a novice.


Here is an example scenario:

When a user visits the directory page, they can currently select a city (from a list of cities). This takes them to a page listing business in that city.

If the user selects Birmingham, they are taken to a list of businesses located in Birmingham.

At the side of the page their should be a list of services provided by these businesses. E.g. swimming lessons, personal training, boot camps.

When clicking on “swimming lessons”, they should be taken to a page with a list of businesses which provide swimming lessons in Birmingham.

Here is an experimental version of the site and the repo:

Neither of these are clear to me. Please provide an example of each.

1 Like

Sorry, I can see that wasn’t clear. I have updated my post.

I solved this problem by changing how I used the taxonomy terms.

Instead of using a term like “boot camps” I used terms like “birmingham/boot camps”. Then when listing the services in the sidebar, I used pathBase to display only the term after the slash.

This proved to have added benefits, as the url now states something like …/directory/birmingham/boot-camps… logical!