Issue with website based on PaperMod

Hi!

I am having weird issues with by website based on the PaperMod theme.
Previous, I had a website the the following website structure:

Content folder:

├── content
│  ├── about
│  │  └── index.md
│  ├── contact
│  │  └── index.md
│  └── posts
│     ├── cross-compile-rust-rpi.md
│     ├── gsoc-post.md
│     ├── max11619-driver-rust.md
│     ├── packaging-python-in-2023.md
│     ├── rust-ecosystem.md
│     └── rust-strategy-pattern.md

This works without issues. However, I now want to rework my website a bit, so I have a different structure

├── content
│  ├── blog
│  │  ├── _index.md
│  │  ├── cross-compile-rust-rpi.md
│  │  ├── gsoc-post.md
│  │  ├── max11619-driver-rust.md
│  │  ├── packaging-python-in-2023.md
│  │  ├── rust-ecosystem.md
│  │  └── rust-strategy-pattern.md
│  ├── contact
│  │  └── index.md
│  ├── index.md
│  └── projects
│     └── index.md

This is falling apart and I don’t understand why. It’s also very difficult to debug for me, and I don’t know where to start. Sometimes, the website renders fine how I expect it to do (e.g. when I re-save some of the files in the content dir), but other times I only get error 404 for some pages, the home page is empty. Sometimes I see blogposts on the home page (I do not want that), sometimes the home page renders fine. Sometimes the blogpost render fine but it still does not look like the default version I had previously.

The website can also be found here: GitHub - robamu/rob.blog.dev: Personal Blog, powered by Hugo

Anything that is obviously wrong or some ideas where and how I need to search for the issue?
This is the menu section of hugo.toml, which I tried to keep as close to the veriant proprosed by PaperMod:

[menu]

[[menu.main]]
name = "Home"
url = "/"
weight = 1

[[menu.main]]
name = "Projects"
url = "/projects/"
weight = 2

[[menu.main]]
name = "Blog"
url = "/blog/"
weight = 3

[[menu.main]]
name = "Contact"
url = "/contact/"
weight = 4

The full branch with all the changes: GitHub - robamu/rob.blog.dev at restructure-website

Rename the index.md file in the root of your site to _index.md.

Wow, the solution is actually that simple. Thanks a lot! I thought I tried around with converting the index files to _index.md, but something else must have gone wrong when I tried this, or I converted the wrong files.

After reading up some more documentation, I think I am starting to understand the difference and why this is necessary better. I just wondered why the rendering worked sometimes…

Kind Regards
Robin

One of the reasons that Hugo is fast is that it renders your templates in parallel. When you see inconsistent behavior from one run to the next, it is almost always related to this concurrent processing.

In your case, this would be obvious by running hugo --printPathWarnings. You would see one page (home) clobbering itself on every build. Sometimes the home page would be generated automatically and written to public/index.html, only to be clobbered when index.md was rendered. Or the other way around.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.