[SOLVED] Basic scenario failing: non-index page not rendering

Hi all,

I’m trying to learn the basics of Hugo by doing a small website with a few different static pages using the same layout. No blog or complicated things. I wish to do my own theme or layout since no themes that already exists really suits my need.
I was not expecting that much trouble into making that happen to be honest… !
My issue is that I can’t generate anything else that the index page ! And I fail to see any logs and debug output that can help me.

I tried different tutorial, only a few that explains from scratch. The best one I’ve found so far is this one and it does not work for me.
I’m running hugo v0.38.2.

For the sake of clarity, here’s what does not work for me:

hugo new site .

cat > layouts/index.html <<EOF
<html>
<body>
hello
</body>
</html>
EOF

hugo new about.md
echo "Helllo about" >> content/about.md

hugo

There’s no about page ever created. I tried filling in layouts/_default/single.html with:

<html>
<body>
{{ .Content }}
</body>
</html>

But nothing gets created except the index.html page…
What am I missing ?
I know this is a Hugo-beginner question and there’s probably something huge I missed from my side, but I would have hoped that this type of basic tasks would have been a bit easier and clearer for Hugo-beginners… It may be worth adding some doc for covering that scenario. Just saying… :slight_smile:

Thanks a lot !

Most likely, you have an index.md file instead of an _index.md in the content dir where the other md files are not rendered. If so, rename it to the latter.

For more details:


For more help, please share your site source.

Hi, thanks for answering.
Unfortunately, I have no such files.
Have you tried my code snippets above ? This is exactly what I’m trying to do …

Thanks

hugo new, given the default archetype template, creates a draft (draft: true) in front matter.

Try build with:

hugo -D

Or “undraft” it.

1 Like

Thanks that was it.
Something simple I missed indeed… !!
Thank you very much !

PS: I still believe this is something that should be more clearly expressed in the output of hugo or stg. (like drafted page: xxx.md, yyy.md …)

We had it in the “build summary”, but it got lost in a refactoring at some point; it was too hard to keep it … But I agree.