I’m getting started with Hugo to build a new website, with a from-scratch theme. While starting with the homepage, I’m running into trouble with which template is used. Sometimes it renders as expected with the “layouts/index.html” but usually it renders using “layouts/_default/list.html” but no pages.
As far as I can tell, it’s just random. For a little bit it seemed like changing
disableHugoGeneratorInject in my config “fixed” it, or it seemed like setting
draft: false fixed it, or passing
--disableFastRender to the server, etc. etc. but so far the only theory I’m left with is that each time I run
hugo or re-start/re-trigger the server I get a random result :-/
Why would my index.html often get generated with the lists template (which I don’t want — certainly not with a seemingly empty list), but occasionally generate with the index template that I thought it would always use?
I’ve posted the current (problematic) source code at https://github.com/natevw/hugo-homepage-issue/tree/a6ea417c24407b9d0f511605a6238599b3401e23/themes/homespun/layouts
Basically started with:
hugo new site . -f json hugo new theme homespun
And then went from there. My content/_index.md is very simple and I got rid of the
draft: true line to eliminate that as a variable.