How exactly do I specify a layout for a taxonomy list?

I’ve started implementing taxonomy (tags), and I’m having a bit of trouble with the template order.

I have a layouts/_default/list.html that’s adapted for tags as well. The problem is that it isn’t adapted for /tags.html, and doing that in a single template does not make sense.

layouts/taxonomy/tag.html specifies the template for the term list, so for an instance, /tags/some-tag is modified. Using layouts/taxonomy/list.html affects both the term list, as well as the taxonomy list (/tags.html).

I did take a look at the template lookup order, but I can’t for the life of me figure out which template I’m supposed to use to only affect /tags.html, and let /tags/some-tag fall back to the default list.html. What template file name/location can I use to only affect tags.html?

There’s no specific code relevant to this, but here’s my relevant project structure:

content
    + posts [ Markdown here contains tags ]
        + A.md 
        + B.md
        + ...
    + _index.md
layouts
    + _default
        + list.html
        + baseof.html
        + single.html
    + taxonomy
        + [currently empty, but has contained tag.html, taxonomy.html, tags.html, and list.html]

The taxonomy config is extremely minimal, if it matters:

taxonomies:
  tag: tags

Also, the site is built with uglyurls: true. tags.html might be /tags/ without it.

Have you played with layouts/tags/tags.html vs layouts/tags/terms.html?

2 Likes

layouts/tags/terms.html does the trick. Thought that was for the list of pages with a specific tag (i.e. /tags/some-tag) and not the tag list, but it does only affect /tags.html. Thanks ^^