Assuming you have the correct layouts in place, and default config. (This is where it would really help us to see code for your site)
Having any one of the three below:
content/what-we-do.md
content/what-we-do/index.md
content/what-we-do/_index.md
will lead Hugo to generate a page on yoursite.com/what-we-do/
.
There are a few small differences between them though, and which one you use will depend on what you want to do and how you want to organise your content.
#1 vs #2:
These are both considered regular single pages; these have no child pages. By default they will use the /layouts/_default/single.html
layout file, unless a more specific layout file is applicable (see https://gohugo.io/templates/lookup-order/#examples-layout-lookup-for-regular-pages).
So whatβs the difference? #2 is a Leaf-type Page Bundle (see https://gohugo.io/content-management/page-bundles/#leaf-bundles). This means that you can nest related resources under it.
For example:
βββ content
β βββ what-we-do
β β βββ index.md
β β βββ some-photo.jpg
β β βββ other-photo.png
β β βββ document.pdf
This is convenient because you can keep related βthingsβ together.
#3:
This is a Branch-type Page Bundle (see https://gohugo.io/content-management/page-bundles/#branch-bundles). Unlike the first two, this can have child sub-pages under it.
By default this will use the /layouts/_default/list.html
layout file, unless a more specific layout file is applicable (see https://gohugo.io/templates/lookup-order/#examples-layout-lookup-for-section-pages).
For example:
βββ content
β βββ what-we-do
β βββ _index.md # generates yoursite.com/what-we-do/
β βββ we-can-sing.md # generates yoursite.com/what-we-do/we-can-sing/
β βββ we-can-dance
β β βββ index.md # generates yoursite.com/what-we-do/we-can-dance/
β βββ we-can-paint
β βββ paint.png
β βββ index.md # generates yoursite.com/what-we-do/we-can-paint/
But this all only work with the assumptions I mentioned in the beginning. Does your theme have the correct and necessary layout files? What does your config actually look like?
We can only guess. We cannot possibly know what you want to accomplish and how you are trying to do that with what little information you have provided. This is why we keep asking if you have your code somewhere we can have a look at.