Hugo: 404 for content until source changes

Created on 17 Jun 2018  路  4Comments  路  Source: gohugoio/hugo

Hugo version: Hugo Static Site Generator v0.42.1 darwin/amd64
OS: macOS 10.13.4

Steps to reproduce:

  1. Create empty content file at /content/about/_index.html (or use hugo new)
  2. Copy /layouts/_default/single.html to /layouts/section/about.html
  3. Run hugo server -E -F -D
  4. Load http://localhost:1313/about/ in browser (with cache disabled)
    Expected Result: an empty page
    Actual Result: 404 page not found
  5. Append "some dummy content" to /content/about/_index.html and save
  6. Load http://localhost:1313/about/ in browser (with cache disabled)
    ER/AR: "some dummy content" shows in browser
  7. Restart the hugo server
  8. Load http://localhost:1313/about/ in browser (with cache disabled)
    ER: "some dummy content" shows in browser
    AR: 404 page not found

This doesn't appear to be isolated to new blank, content pages. It also doesn't appear to be isolated to hugo server as building with hugo also doesn't generate a static page. Even more frustrating is that this doc suggests that I shouldn't have to create a layout file per section and instead the default/single should be used, but that also doesn't seem to be true for me :(

This is my first project using Hugo, so perhaps I don't understand the system well enough.

Most helpful comment

@bep I apologize if I offended you. Your initial response doesn't mention that this may be an implementation error rather than a bug. In any case, thank you for the quick responses and your contribution to this OSS project.

For others arriving here, the issue for me was that /content/index.html needed to be renamed to /content/_index.html per this thread. Related documentation

All 4 comments

Thanks for getting in touch, but it feels like this is a question that would be better suited to the Hugo Discussion Forum. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug. You may also find the answers you search for in Hugo Documentation.

@bep so this is expected behavior?

@bep so this is expected behavior?

No, I was expecting something different. I expected you to follow my advice and open up a thread on the forum where more people could help troubleshoot it.

I spot something odd with your setup, and I'm pretty sure this isn't a new issue. If I'm proven to be mistaken, we will reopen this issue.

But remember this, this is a popular, but very low-staffed OSS project. This "forum delegate" method is the only way to manage the number of issues we get.

@bep I apologize if I offended you. Your initial response doesn't mention that this may be an implementation error rather than a bug. In any case, thank you for the quick responses and your contribution to this OSS project.

For others arriving here, the issue for me was that /content/index.html needed to be renamed to /content/_index.html per this thread. Related documentation

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VoidingWarranties picture VoidingWarranties  路  3Comments

crash-dive picture crash-dive  路  3Comments

arikroc picture arikroc  路  3Comments

kaushalmodi picture kaushalmodi  路  3Comments

chrissparksnj picture chrissparksnj  路  3Comments