Just recently I’m finding that one of my pages isn’t building correctly. It’s almost like a list.html
is trying to render as a single.html
. I cannot figure out what is going wrong.
The odd thing is that if I delete the template that isn’t being generated so that _default/list.html
is used instead I get exactly the same issue. So for the moment I’m going to discount my custom list template as the problem. I will describe the setup for background though.
So, I have a directory in content
called committee
. This has an _index.md
in it which just has frontmatter. In the committee
directory I have a directory for each committee member and in each of those directories I have an index.md
and an image. The custom list template I have in layouts/committee/list.html
iterates over the pages (i.e. committee members) and creates a table with their image, name, email address, etc. It’s actually pretty simple and has worked well for a couple of years.
As mentioned above I’ve removed my template which creates the table so that _default/list.html
is used and what I see when I run live locally is a random committee member name and email address. This implies that my committee/list.html
is actually trying to behave as if it were a committee/single.html
, which is really odd. If I then go into _default/list.html
and save that file (with zero changes) the page instantly refreshes and it renders exactly as expected, i.e. a list of links to the committee pages. I see the same behaviour when I reinstate my custom committee/list.html
. Start the server and see a random committee members name, hit save on committee/list.html
with a tiny change and it renders as expected.
This really odd and I can’t figure out what’s happening.