# Regular pages from a section in a nested list

**URL:** https://discourse.gohugo.io/t/regular-pages-from-a-section-in-a-nested-list/15707
**Category:** support
**Created:** [December 7, 2018, 4:51pm UTC](https://discourse.gohugo.io/t/regular-pages-from-a-section-in-a-nested-list/15707 "2018-12-07T16:51:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![frangipani](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frangipani/32/5558_2.png) [@frangipani](https://discourse.gohugo.io/u/frangipani)
#### Post date: [December 7, 2018, 4:51pm UTC](https://discourse.gohugo.io/t/regular-pages-from-a-section-in-a-nested-list/15707/1 "2018-12-07T16:51:29Z")

</div>

Trying to list the top-level sections and their pages:

```auto
<ul>
	{{ range .Site.Sections }}
	  	<li>
		    <a href="{{ .RelPermalink }}">{{ .Name }}</a>
			<ul>
				{{ range where .Site.RegularPages "Section" .Name }}
					<li>
						<a href="{{ .Permalink }}">{{ .Title }}</a>
					</li>
				{{ end }}
			</ul>
	    </li>
	 {{ end }}
</ul>

```

Content structure:

```auto
content/

    - section1/
        - page1/
            index.md
        - page2/
            index.md
        _index.md

    - section2/
        - page1/
            index.md
        - page2/
            index.md
        _index.md

```

… And I only get the two section names, without the pages under them.

---

<div class="post-metadata">

### Author: ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)
#### Post date: [December 7, 2018, 5:23pm UTC](https://discourse.gohugo.io/t/regular-pages-from-a-section-in-a-nested-list/15707/2 "2018-12-07T17:23:00Z")

</div>

Try this:

```auto
<ul>
{{ range .Sections }}
  <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
  <ul>
  {{ range .Pages }}
    <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
  {{ end }}
  </ul>
{{ end }}
</ul>

```

---

<div class="post-metadata">

### Author: ![frangipani](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frangipani/32/5558_2.png) [@frangipani](https://discourse.gohugo.io/u/frangipani)
#### Post date: [December 7, 2018, 5:28pm UTC](https://discourse.gohugo.io/t/regular-pages-from-a-section-in-a-nested-list/15707/3 "2018-12-07T17:28:41Z")

</div>

Doesn’t work ☹

I think this was one of the first things I tried.

---

<div class="post-metadata">

### Author: ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)
#### Post date: [December 7, 2018, 5:36pm UTC](https://discourse.gohugo.io/t/regular-pages-from-a-section-in-a-nested-list/15707/4 "2018-12-07T17:36:48Z")

</div>

This works for me. Perhaps your pages have `draft` set to `true` ?

---

<div class="post-metadata">

### Author: ![frangipani](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frangipani/32/5558_2.png) [@frangipani](https://discourse.gohugo.io/u/frangipani)
#### Post date: [December 7, 2018, 5:40pm UTC](https://discourse.gohugo.io/t/regular-pages-from-a-section-in-a-nested-list/15707/5 "2018-12-07T17:40:45Z")

</div>

My goodness… How did you know? 😶

---

<div class="post-metadata">

### Author: ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)
#### Post date: [December 7, 2018, 5:45pm UTC](https://discourse.gohugo.io/t/regular-pages-from-a-section-in-a-nested-list/15707/6 "2018-12-07T17:45:47Z")

</div>

Happens to me all the time 😛

---

<div class="post-metadata">

### Author: ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)
#### Post date: [December 8, 2018, 2:58am UTC](https://discourse.gohugo.io/t/regular-pages-from-a-section-in-a-nested-list/15707/7 "2018-12-08T02:58:38Z")

</div>

Ahem, [Your content isn't showing because it is a draft](https://discourse.gohugo.io/t/your-content-isnt-showing-because-it-is-a-draft/14585). Pass it on! 🙂
