I want to use a specific template when listing some of my tags.
For example if I have a tag called bob.
I have created a bob directory under content/tags with an _index.md file.
[content]
[tags]
_index.md
[bob]
_index.md
This bob/_index.md file has frontmatter set to override the layout file used.
layout: bob
Under layouts I have created a folder for bob with a list.html file.
[layouts]
[tags]
list.html
[bob]
list.html
When I navigate to “http://localhost:1313/tags/bob/” it does not use list.html in the bob folder but always instead uses the layouts/tags/list.html file.
Unless I have misunderstood I have tried to follow the solution in this posting:
Are you sure tags are declared as taxonomy (by default they are). The answer your are sharing above do not refer to taxonomies but to content types (recipe)
If tags is indeed a taxonomy, /tags/bob will use a term.html template and be of Kind term while /tags will use the taxonomy.html template and be of Kind taxonomy.
So in your layouts/tags directory you can create
I am using default settings so tags will be a taxonomy.
In layouts/tags I can name file list.html or taxonomy.html, both work and are used to list all tags correctly.
Tried renaming layouts/tags/bob/list.html to term.html.
But never uses this. Always uses layouts/tags/list.html.
Should I be setting content/tags/bob/_index.md file with “layout: term” (or variation)?
I can obviously make this work by doing an if else if else if else in layouts/tags/list.html to achieve what I want?
Just thought it was possible (and tidier) to have a specific template for each tag.