Build output is different everytime

I’m seeing different outputs with Hugo when I’m not changing anything. At first I noticed that even in the dev server, sometimes it wasn’t generating pages, but then I could see that at times, it would not generate specific sections of pages.

I’ve recorded the video below of me running the build command several times in a row. On the screen you can see the homepage from the output directory, and you can clearly see that every few runs, content disappears (The content that disappears is the actual page content and all that is left is the template content). Has anyone seen this before?

There is something really funky around index files that I can’t quite pinpoint.

There is this thread here :

That is very similar to the issue I have when I run the local dev server. More importantly it says :

“HOWEVER, this only appears to occur if content contains a “” file. If that is missing then all is well.”

So I instead made a TEMPLATE called index.html, and removed my index.html file from my content hierarchy, and everything works fine.

There is also another issue here with the same problem :

I see exactly the same sorts of issues when running the dev server locally. It won’t build specific pages unless I touch them in some way, and then it will. But if I seem to remove my index.html file from the root of the content tree, everything works fine.

Can you share a repository with us?

If that’s a template it doesn’t belong there. If it’s a content file it needs to begin with an underscore, and it must contain front matter.