I’m having difficulties setting up my theme, because hugo server jumps between serving and not-serving files.
Right now when I start it, it serves a blank, or rather a <pre></pre> response. When I save a file, e.g. in the content tree (without changing it) and refresh the page, Hugo registers the event and serves again.
Is there some way I can get more information out of Hugo? The --verbose flag is not more informative. I also tried --gc in case some cruft was left in the pipeline.
But that’s my homepage (not a list page), shouldn’t it stay as is?
You don’t have a default list.html template.
Yeah, I won’t have any list pages aside from /events/, so I’m keeping the layout as sparse as possible to avoid confusion/duplication. Hugo doesn’t seem to look for a default list template in this arrangement.
What I did notice now is that Hugo doesn’t see my files until I save them! So it returns blanks because it thinks /content/events/ is empty!
I rebooted in-between so this doesn’t appear to be some synchronization issue with my text editor. The project is located in a regular filesystem along with my OS, nothing unusual. Weird!
Edit: Someone stumbled upon the same problem it seems.
I’ve filed an issue on GitHub. Maybe I’m just doing something wrong, but it’s not obvious from the documentation, so either way something insightful should come of this.
The odd behavior was caused by having /content/index.md instead of /content/_index.md as pointyfar pointed out. For me the former worked (misleading!) and the latter didn’t because I had
disableKinds = ["home", …]
in my config.yaml, thinking it would just disable the need for a dedicated homepage template, not the rendering of that page per se.
So the solution is:
Don’t disable homepage kind
Rename homepage to /content/_index.md
(Add homepage template)
Now Hugo sees items under the /content/events/ section just fine without the shenanigans described in my first post. “Debugging difficulties” indeed