Sub-page or mulitple site stucture

Hey, Everyone, I am working on this website, which is a 3-in-1 site. Basically, the client was looking for a site that he could use for all three of his business or whatever.

So first is for his medical center, 2nd is a Hijama site, and the third is basically donations for a Masjid that he is building. So about an estimate of 18 pages. he wanted to use a single domain for all those. So I thought why not use Hugo It would be fast n ez :slightly_smiling_face:

So here’s what I am doing.

content/
β”œβ”€β”€ pages/
β”‚   └── main/
β”‚   β”‚     └── home/
β”‚   β”‚     β”‚     └── _index.md
β”‚   β”‚     └── services/
β”‚   β”‚     β”‚     └── _index.md
β”‚   β”‚     └── team/
β”‚   β”‚     β”‚     └── _index.md
β”‚   β”‚     └── about/
β”‚   β”‚     β”‚     └── _index.md
β”‚   β”‚     └── contact/
β”‚   β”‚     β”‚     └── _index.md
β”‚   └── mmc/
β”‚   β”‚     └── home/
β”‚   β”‚     β”‚     └── _index.md
β”‚   β”‚     └── services/
β”‚   β”‚     β”‚     └── _index.md
β”‚   β”‚     └── team/
β”‚   β”‚     β”‚     └── _index.md
β”‚   β”‚     └── about/
β”‚   β”‚     β”‚     └── _index.md
β”‚   β”‚     └── contact/
β”‚   β”‚     β”‚     └── _index.md
β”‚   └── rjis/
β”‚   β”‚     └── home/
β”‚   β”‚     β”‚     └── _index.md
β”‚   β”‚     └── services/
β”‚   β”‚     β”‚     └── _index.md
β”‚   β”‚     └── team/
β”‚   β”‚     β”‚     └── _index.md
β”‚   β”‚     └── about/
β”‚   β”‚     β”‚     └── _index.md
β”‚   β”‚     └── contact/
β”‚   β”‚     β”‚     └── _index.md

and the same structure in layout pages/ instead of content/ and with list.html & single.html instead of _index.md obviously there are more pages but this is just to simplify things.

Now the first issue I faced with this structure is the nav stopped working for some reason. I works fine if you put the site dirs outside of pages/ and content/ Here’s what my nav looks like

baseURL = 'https://example.org/'
languageCode = 'en-us'
title = 'Laser Experts'


# Laser Expert Main Menu
[menu]
    [[menu.lasermenu]]
        identifier = "home-laser"
        name = "Home"
        pageref = "/pages/main/home/"
        weight = 1
    [[menu.lasermenu]]
        identifier = "services-laser"
        name = "Services"
        pageref = "/pages/main/services/"
        weight = 2
    [[menu.lasermenu]]
        identifier = "gallery-laser"
        name = "Gallery"
        pageref = "/pages/main/gallery/"
        weight = 3
    [[menu.lasermenu]]
        identifier = "team-laser"
        name = "Our Team"
        pageref = "/pages/main/team/"
        weight = 4
    [[menu.lasermenu]]
        identifier = "about-laser"
        name = "About Us"
        pageref = "/pages/main/about/"
        weight = 5
    [[menu.lasermenu]]
        identifier = "contact-laser"
        name = "Contact Us"
        pageref = "/pages/main/contact/"
        weight = 6
    [[menu.droplaser]]
        identifier = "pages"
        name = "Links"
        pageref = "#"
        weight = 7
    [[menu.droplaser]]
        identifier = "home-mmc"
        name = "Madina Medical Centre"
        pageref = "/pages/mmc/home/"
        parent = "pages"
        weight = 8
    [[menu.droplaser]]
        identifier = "home-rjis"
        name = "Riaz-ul-Jannat"
        pageref = "/pages/rjis/home/"
        parent = "pages"
        weight = 9

# MMC Site Menu

    [[menu.mmcmenu]]
        identifier = "home-mmc"
        name = "Home"
        pageref = "/pages/mmc/home/"
        weight = 1
    [[menu.mmcmenu]]
        identifier = "facilities-mmc"
        name = "Facilities"
        pageref = "/pages/mmc/facilities/"
        weight = 2
    [[menu.mmcmenu]]
        identifier = "hair-mmc"
        name = "Hair Transplant"
        pageref = "/pages/mmc/hair/"
        weight = 3
    [[menu.mmcmenu]]
        identifier = "liposcutions-mmc"
        name = "Liposcutions"
        pageref = "/pages/mmc/liposcutions/"
        weight = 4
    [[menu.mmcmenu]]
        identifier = "clinics-mmc"
        name = "OPD Clinics"
        pageref = "/pages/mmc/clinics/"
        weight = 5
    [[menu.mmcmenu]]
        identifier = "about-mmc"
        name = "About Us"
        pageref = "/pages/mmc/about/"
        weight = 6
    [[menu.mmcmenu]]
        identifier = "contact-mmc"
        name = "Contact Us"
        pageref = "/pages/mmc/contact/"
        weight = 7
    [[menu.dropmmc]]
        identifier = "pages"
        name = "Links"
        pageref = "#"
        weight = 8
    [[menu.dropmmc]]
        identifier = "home-laser"
        name = "Laser Experts"
        pageref = "/pages/main/home/"
        parent = "pages"
        weight = 9
    [[menu.dropmmc]]
        identifier = "home-rjis"
        name = "Riaz-ul-Jannat"
        pageref = "/pages/rjis/home/"
        parent = "pages"
        weight = 10


# Riaz-ul-Jannah Site Menu
    [[menu.rjismenu]]
        identifier = "home-rjis"
        name = "Home"
        pageref = "/pages/rjis/home/"
        weight = 1
    [[menu.rjismenu]]
        identifier = "about-rjis"
        name = "About Us"
        pageref = "/pages/rjis/about/"
        weight = 2
    [[menu.rjismenu]]
        identifier = "donations-rjis"
        name = "Donations"
        pageref = "/pages/rjis/donations/"
        weight = 3
    [[menu.rjismenu]]
        identifier = "team-rjis"
        name = "Our Team"
        pageref = "/pages/rjis/team/"
        weight = 4
    [[menu.rjismenu]]
        identifier = "about-rjis"
        name = "About Us"
        pageref = "/pages/rjis/about/"
        weight = 5
    [[menu.rjismenu]]
        identifier = "contact-rjis"
        name = "Contact Us"
        pageref = "/pages/rjis/contact/"
        weight = 6
    [[menu.droprjis]]
        identifier = "pages"
        name = "Links"
        pageref = "#"
        weight = 7
    [[menu.droprjis]]
        identifier = "home-laser"
        name = "Laser Experts"
        pageref = "/pages/main/home/"
        parent = "pages"
        weight = 8
    [[menu.droprjis]]
        identifier = "mmc"
        name = "Madina Medical Centre"
        pageref = "/pages/mmc/home/"
        parent = "pages"
        weight = 9

and this is code I am using to fetch the nav

            <div id="irtfd" class="gjs-grid-column">
              {{ if eq .Section "mmc" }}
                  {{ partial "common/menu/mmc.html" . }}
              {{ else if eq .Section "rjis" }}
                  {{ partial "common/menu/rjis.html" . }}
              {{ else }}
                  {{ partial "common/menu/laser.html" . }}
              {{ end }}
              </div>
          </div>
        </div>
        <div id="id7x" class="gjs-grid-column">
          <div class="dropdown">
            {{ if eq .Section "mmc" }}
                {{ partial "common/dropdown/mmc.html" . }}
            {{ else if eq .Section "rjis" }}
                {{ partial "common/dropdown/rjis.html" . }}
            {{ else }}
                {{ partial "common/dropdown/laser.html" . }}
            {{ end }}
          </div>

Code for the partial menus

laser.html

{{ $currentPage := . }}
{{ range .Site.Menus.lasermenu }}
<a href="{{ .URL }}" class="gjs-link ms-2">{{ .Name }}</a>
{{ else }}
<a href="{{ .URL }}" class="gjs-link ms-2">{{ .Name }}</a>
{{ end }}

mmc.html

{{ $currentPage := . }}
{{ range .Site.Menus.mmcmenu }}
<a href="{{ .URL }}" class="gjs-link ms-3">{{ .Name }}</a>
{{ else }}
<a href="{{ .URL }}" class="gjs-link ms-3">{{ .Name }}</a>
{{ end }}

rjis.html

{{ $currentPage := . }}
{{ range .Site.Menus.rjismenu }}
<a href="{{ .URL }}" class="gjs-link ms-2">{{ .Name }}</a>
{{ else }}
<a href="{{ .URL }}" class="gjs-link ms-2">{{ .Name }}</a>
{{ end }}

The 2nd issue I am facing is just like the nav if the list.html for let’s say main/ isn’t in the root of main It doesn’t anything content, but If I put in the root all pages start showing that content instead of the content form their root.

Do I need to do something like this maybe idk help me out please

content/
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ main-home/
β”‚   β”‚   └── _index.md
β”‚   β”œβ”€β”€ main-about/
β”‚   β”‚   └── _index.md
β”‚   β”œβ”€β”€ mmc-home/
β”‚   β”‚   └── _index.md
β”‚   β”œβ”€β”€ mmc-about/
β”‚   β”‚   └── _index.md

this is what the _index.md files look like

---
title: Home | Laser Experts
type: home-laser
url: /main/
---

Okay so I managed to fix the menu you can see here what I did
This now leaves the content not showing up… btw I also moved all the dirs to pages you can also see that in the commit.

I suspect no one has responded due to the length of your post.

Can you summarize your question in two or three sentences?

page doesn’t fetch content from list.html
Here’s the repo GitHub
As of now there’s some content in home-main and services-main

Which page?

basically every page that I created, none them show the content, if you can read the details, you will know. I am basically facing two issue, I fix one and start facing the other, I fix the 2nd and start facing the first one. I can’t summarize it more then this, english isn’t my first language.

Your templates don’t call .Content.

Your templates don’t range through pages.

Your _index.md files don’t contain content.

And one of your pages is clobbering another. Run hugo --printPathWarnings for details.

the _index.md are not going to contain anything, the design is going to be in the list.html files of the pages, as I had mentioned the only pages that contain content are in layouts/ home-main and services-main

And neither of the templates for those pages call .Content.