Content/static pages not build. Incomplete setup "structure"?

Hi,

odd behavior happens to my HUGO setup.
Running the server with hugo server --disableFastRender -D does not serve some pages, until they are saved. Although the HTML pages are there. But it seems the “save” event from my editor triggers in the HUGO observer something like “now the file exists”.

Another point is, that most if not all of my HTML content pages aren’t exported on build and I don’t know why.
I tested with draft set to true, than false. Than different front matter.
I’ve used different commands, but ultimately: hugo -D -E -F --gc --minify
Maybe its because I’m just using a custom theme and content pages. Nothing else.
A simplified example of my setup: GitHub - yi0n/hugo-test (Link to the source code repository)

hugo env
hugo v0.116.1-3e1ea030a5897addaf9d113d0826709fe07f77c0 windows/amd64 BuildDate=2023-08-01T07:24:54Z VendorInfo=gohugoio
GOOS=“windows”
GOARCH=“amd64”
GOVERSION=“go1.20.1”
PowerShell 7.3.6

For setting up a HUGO project, I tried to find good default example structures (even on Github, except some outdated ones and it was already hard to find out on how to lay out a theme’s layout/_default and partials) that might clarify things.

What am I doing wrong?

Thanks for clarification.

mv content/index.html content/_index.html
1 Like

Changing from index.html to _index.html helped in building the public structure! Thank you very much.
Good to point out that in subdirectories of content/ having also _index.html won’t build their respectively index.html. Seems only allowed in content root.

Oddly, the startpage will show Error 404 by this change, when running the hugo server for inspection of the page.

If you need additional assistance, please post a link to the public repository for your project.

See Requesting Help.

Let us see your code

Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.

If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

I did in my initial post. Or is something missing?

Yes. You haven’t updated it since your initial posting.

image

I expected to see “_index.html” not “index.html”.

The repository is updated now.

I may have found out what caused it.

The file index.html in themes/transit_converted/layouts/ was empty.
I thought every page’s default layout gets pulled from themes/transit_converted/layouts/_default/single.html

Right as I copied over the content from _default/single.html into the index.html, the first page is shown!