Pages disappear until re-saved

I’m just getting used to using Hugo, playing around on local machine, but one problem I can’t figure out. I’m using the Whiteplain theme and sometimes when running the server all the content pages disappear. The home page remains as do two of the list pages (tags, and categories) but there are no pages listed there. An About page and a links page give 404’s.

Two specific causes have been:

  1. After stopping and restarting the server
  2. I added a menu item to the config.toml file

I’m running the server in draft mode. I’ve tried disabling fast render and also used --verbose to try to get some clues but nothing.

I can get all the pages back if I make minor edits and resave the files while the server is running.

Looking through the forums I saw some mention of file encoding problems. I’m generating most of the markdown files through hugo new, via git-bash on Win 10. This results in US ascii files. The markdown files that came with the theme are UTF-8. Don’t know whether that’s relevant or not.

I’ve generated several different sites with different themes and had similar problems on some of those too. I’m mostly not building the sites to the public directory. Though I tried this on one and it didn’t help.

I’m using VS Code for editing. I’ve not touched the existing templates and only made very minor changes to the CSS.

Any help much appreciated.


It’s hard to say if you are having an issue with your content structure or with the theme. You could set your Windows setup to using UTF8 (there is in general no reason, why you shouldn’t always do this. US ASCII is very specific and was maybe important back in the 32bit times, but now you can always go with UTF8. disclaimer: that’s an opinion. disclaimer 2: I do not think that will solve your issue. My guess is that there is something weird going on with vs and folder structure. Let us see your repo :slight_smile:

Hi and thanks for the reply. It seems to be fixed now. I replaced the contents of the config file with those from the README file. I think I got the first config from the examplesite possibly. Not sure. I did a file compare between the two and while there are differences nothing obvious.

So I’m sort of glad it’s fixed though I would have liked to have known more precisely what I’d done wrong so I don’t make the same error in the future.

1 Like

In fact I finally worked it out based on your comment.

If I create a home page: content/ that messes everything up and other list pages appear empty. The default home page is a list page though there is no content/ So still figuring out how this all works I’m afraid.

1 Like