/content/ Directory Not being display, only 404 error page

#1

How It Was Before

I was using the standard /content/ directory for all my pages and blog posts. Nothing much, a few directories and sub-directories and plus or minus 30 files. All was working.

The Problem

In my dev environment only (don’t yet have a public site), on Linux (Debian jessie 3.16.0-4-amd64) with hugo version 0.37
When I http://localhost:1313 the homepage appears with all the TABS and content (except the BLOG section where there are no posts). But when I want to go to a TAB, I get the following: “404 page not found” (not the nice hugo one). This is for everything in /content/

What I Did To Make This Happen

  1. mv content/blog/diary/me/ trashdirectory/
  2. Then “The Problem”.
  3. Troubleshooting
  4. So obviously I moved the directory back, but didn’t work.
  5. I restarted/rebuilt/put verbose and debug/created new files/directories, nothing worked content/ just didn’t work.
  6. Created a new dir testcontent/ with a new file, moo.md and ran hugo with -c testcontent/ Worked great for moo.md and the blog didn’t give a 404 page but a blank page.
  7. cp content/ to testcontent/ still running hugo on -c testcontent/ and all works, except the blog which gives a blank page or certains things don’t work (don’t remember exactly because I can’t reproduce it!) AND NOW this doesn’t work anymore either.
  8. So I created a new directory moomoo/ with a moo.md file and ran hugo with -c moomoo/ and it works now!!!
  9. cp -R content/ to moomoo/ and works great except for blog which is a blank page. BUT… when I restart hugo then moomoo/ doesn’t work anymore. So I could keep on going, works once.
  10. This is my run command to hugo (but it hasn’t changed since before the problem): hugo server -D --bind=“0.0.0.0” -c moomoo/

How To Fix

  1. Do it the lazy way and use a new dir like testcontent/ moomoo/ but it doesn’t seem to be stable and work indefinitely and would require figuring out why the blog doesn’t work AND my husband will kill me for taking this route and not fixing the problem.
  2. Revert to an older version of the site and loose all that I’ve done since the last git push (and, I know it’s bad, but I don’t do it enough) and still a lazy way out which might not work anyway.
  3. Actually fix the problem (but I’ve hit the limits of my troubleshooting and technical skills)

Any ideas? Does anyone know how to fix this?

#2

Can you take a look at the requesting help suggestions? That thread contains useful information that helps us help you. :slight_smile:

From my perspective I don’t know what cp and other commands do, so it would also help if you can describe your problem in platform-agnostic terms.

This doesn’t necessarily have to be a problem with the /content/ directory. It might also be that your theme’s layout files are moved or not used anymore for the content file in question. That would also give blank pages.

To debug that you can take a look at Hugo’s lookup order to see if your content files have a proper layout file for them.

#3

Sorry for the commands, for some reason I assumed everyone was using a linux system.

In short, I have two problems.

  1. /content/ give 404 error page. When I create a /content-1/ then it works once or twice then stops working and I have to create a /content-2/ to make it work once or twice again then stops working and so on. The files/directories in /content/ /content-1/ & /content-2/ are the same in all, I’ve tried playing with them but there is no change. All was working fine until I tried to remove a directory in the /content/blog/ and then all went to hell. Since then I’ve put everything back to how it was but it doesn’t fix anything. (When I use a different directory than /content/ I of course launch hugo with the correct flag so he knows where to get the content.) This is only on my dev environment, I haven’t pushed it live yet, so I am using hugo as a web server.

  2. I get a blank page with the blog, but at this stage I’m not worried about this one, pretty sure that when #1 is fixed it will also be fixed.

Sorry if my first explanation wasn’t clear, I really tried to give all the details. Hope this message is clear enough.

#4

We need code to reproduce. If you don’t share a repo we can clone and troubleshoot, we’d have to somehow reproduce your issue from scratch. Hence why we need some code to see.

If you can’t share your current repo, make a minimal test repo with your issue. :slight_smile: