Tags in hierarchical web site

My website isn’t a blog, it is structured as a hierarchy of topics and subtopics. But I would still like to use tags.

If I am on the top level page, the tag links on the page point to example.com/tag:whatever and it works fine.

If I am viewing a page further down the hierarchy, eg /computers/laptops/windows the tag links point to example.com/computers/laptops/windows/tag:whatever and the link is not found (404).

This happens with the tag links at the bottom of the article, and also the links in the Popular Tags in the sidebar.

I am using twentyfifteen (theme only, not the skeleton) and all my pages are using the item template.

Any ideas?

It’s just a matter of adjusting your theme’s output to link to the appropriate page. The twentyfifteen theme probably assumes the collection is on the current page, so it just links to the current page no matter where you are.

Tags work by filtering the page collection already defined in the page. So you need to point to a page where that collection is defined.