How should I add pages to my Hugo-website?

Hello guys!
The problem is: only the index.md page renders by Hugo, other created by me .md-pages do not transforms to the .html-files.
What should I do in this case?
URL os my web-site is https://splash.org.ru/ :slight_smile:

dragonserw@debian-SerW:~/hugo/splash-org-ru$ cd ./content/ru && tree
.
β”œβ”€β”€ about.md
β”œβ”€β”€ contact-us.md
β”œβ”€β”€ index.md
└── post
    β”œβ”€β”€ bookmark.md
    └── radio.md

2 directories, 5 files
dragonserw@debian-SerW:~/hugo/splash-org-ru/content/ru$ cd
dragonserw@debian-SerW:~$ cd $HOME/hugo/splash-org-ru && hugo env
hugo v0.111.3+extended linux/amd64 BuildDate=2023-03-16T08:41:31Z VendorInfo=debian:0.111.3-1
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.19.6"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.2.4"
dragonserw@debian-SerW:~/hugo/splash-org-ru$ 

Rename content/index.md to content/_index.md. The underscore makes all the difference.

To understand why, please read:

Thank you dear man, frjo!

dragonserw@debian-SerW:~$ tree $HOME/hugo/splash-org-ru/content
/home/dragonserw/hugo/splash-org-ru/content
β”œβ”€β”€ en
β”‚   β”œβ”€β”€ about
β”‚   β”‚   └── _index.md
β”‚   β”œβ”€β”€ contact-us
β”‚   β”‚   └── _index.md
β”‚   β”œβ”€β”€ index
β”‚   β”‚   └── _index.md
β”‚   β”œβ”€β”€ post
β”‚   β”‚   β”œβ”€β”€ bookmark.md
β”‚   β”‚   └── radio.md
β”‚   └── privacypolicy
β”‚       └── _index.md
└── ru
    β”œβ”€β”€ about
    β”‚   └── _index.md
    β”œβ”€β”€ contact-us
    β”‚   └── _index.md
    β”œβ”€β”€ index
    β”‚   └── _index.md
    └── post
        β”œβ”€β”€ bookmark.md
        └── radio.md

12 directories, 11 files
dragonserw@debian-SerW:~$ 

You don’t have to convert every index.md to _index.md if it is not a branch bundle (list, section, etc).

@SerW That is not correct either. You need to read the documentation for β€œPage bundles” I linked to above one more time.

Hello one more time guys.
I do not understand clearly, what is written on that very page.
Does the changes I provide to you through the tee command are right?

dragonserw@debian-SerW:~$ tree $HOME/hugo/splash-org-ru/content
/home/dragonserw/hugo/splash-org-ru/content
β”œβ”€β”€ en
β”‚   β”œβ”€β”€ about.md
β”‚   β”œβ”€β”€ contact-us.md
β”‚   β”œβ”€β”€ index
β”‚   β”‚   └── _index.md
β”‚   β”œβ”€β”€ post
β”‚   β”‚   β”œβ”€β”€ bookmark.md
β”‚   β”‚   └── radio.md
β”‚   └── privacypolicy.md
└── ru
    β”œβ”€β”€ about.md
    β”œβ”€β”€ contact-us.md
    β”œβ”€β”€ index
    β”‚   └── _index.md
    └── post
        β”œβ”€β”€ bookmark.md
        └── radio.md

7 directories, 11 files
dragonserw@debian-SerW:~$ 

And by the way, An annoying bug is about the index β†’ _index renaming: as you can see in the screenshot of my website: https://splash.org.ru/~SerW/Temp/2023-10-26/splash.pdf, most of the text is Ctrl + E, I mean it is centered.
How can I disable that very bug? :slight_smile:

content/
β”œβ”€β”€ en/
β”‚   β”œβ”€β”€ post/
β”‚   β”‚   β”œβ”€β”€ _index.md    <-- section page / branch bundle
β”‚   β”‚   β”œβ”€β”€ bookmark.md
β”‚   β”‚   └── radio.md
β”‚   β”œβ”€β”€ _index.md        <-- home page
β”‚   β”œβ”€β”€ about.md
β”‚   └── contact-us.md
└── ru/
    β”œβ”€β”€ post/
    β”‚   β”œβ”€β”€ _index.md    <-- section page / branch bundle
    β”‚   β”œβ”€β”€ bookmark.md
    β”‚   └── radio.md
    β”œβ”€β”€ _index.md        <-- home page
    β”œβ”€β”€ about.md
    └── contact-us.md
1 Like

I understand, thank you a lot!
Tomorrow I will add underscored index.md into /post :slight_smile:

Good day, Joe!
As I can see, you advice to me not to put the home page, _index.md into ~/index folder.
But if I do so, my home page is not displayed.

I suggest that you take some time to read the documentation and understand what pages and page bundles are about and when/if you use index.md vs. _index.md. As @frjo already pointed out:

Wildly adding and removing underscores is not getting you anywhere, as the rule is quite simple:

  • Use _index.md with anything that is a branch bundle, i.e. it can contain other pages
  • Use index.md with anything that is a leaf bundle, i.e. it does not contain other pages
1 Like

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