How to get a tags page?


The questions might be basic but I am really lost … The core part of the question is, in my layout folder, where do I have to put and how I have to name the html page to produce a page with a tag list ?

I wrote a set of articles, with tags in the article headers, something like:

    - tag1
    - tag2

I made a tags folder in my contents:


Thus if I well understand, tags is now a section of my hugo website.

In my config.tom I put:

    name = "Tags"
    identifier = "tags"
    weight = 300
    url = "/tags/"

By doing this, I obtain a page with the list my tags and looking at the page I know that this page follow the post-list.html partials. I guess, this is because the folder is empty and because tags is a hugo specific name ? What I want to do is to change the layout of this page.

I look at the doc here and here but I did not succeed.
Actually, I don’t understand what is the name of that html file and in which folder I have to put it.

Thanks and sorry for maybe a basic question

1 Like

The template at /tags/ will be a list page, it lists the terms.

I always forget the template naming, but you want either layouts/_default/terms.html or layouts/_default/taxonomy.html (try them in that order, see if the template changes).

1 Like

Thank you. I have created a layouts/_default/terms.html template along with a content/tags/ folder with a file and it works.

Here is the result:

This is my terms.html layout:


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.