Layout changing when I change the content of markdown file

Hello dear hugo users,

I have a problem creating my site with hugo and the the theme “cleanwhite” (hugo-theme-cleanwhite).

My content folder structure is like this:

- about
 | - index.md
- dogs
  |- index.md
- index.md

In the front matter of my files I use layout: page.

At first my created page seemed to be build correctly. But suddenly the page (the content of my md-file) is not rendered anymore. I could reproduce this (sometimes) by doing the following steps.

  • Edit file by adding or removing a letter somewhere under the front matter (content/index.md)
  • Save file
  • restart hugo server (hugo server --disableFastRender -D --log --verbose --printUnusedTemplates --renderToDisk) (I just start this once, and then edit and save the file and then check the browser for changes)

In every layout inside the themes folder (my own layout folder is empty) I edited the layouts by adding a <div>I am layout xxx</div> to it so I can see what’s happening. And on saving the layout really changes from layouts/_default/page.html to layouts/index.html.

Something similar happens to my other pages that are linked in my top menu. Either they are rendered, or I get a 404. Without any changes to the system.

I am using hugo v0.101.0+extended linux/amd64 on Manjaro.

Thank you in advance for any help.

mv content/index.md content/_index.md
content/
├── about/
│   └── index.md
├── dogs/
│   └── index.md
└── _index.md

See https://gohugo.io/content-management/page-bundles.

2 Likes

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