# Listing files only from given section

**URL:** https://discourse.gohugo.io/t/listing-files-only-from-given-section/33631
**Category:** Uncategorized
**Created:** [June 30, 2021, 7:49pm UTC](https://discourse.gohugo.io/t/listing-files-only-from-given-section/33631 "2021-06-30T19:49:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![AndyM](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/andym/32/11725_2.png) [@AndyM](https://discourse.gohugo.io/u/AndyM)
#### Post date: [June 30, 2021, 7:49pm UTC](https://discourse.gohugo.io/t/listing-files-only-from-given-section/33631/1 "2021-06-30T19:49:34Z")

</div>

We are wanting to have out content split into 2 sections in the content directory:

- pages
- job-openings

The idea here is to that the content in each uses a different template in Netlify. Then in a short code:

```auto
{{ $section := "jobs" }}

<ul>
  {{ range (where .Site.RegularPages.ByTitle "Section" $section ) }}
   <li><a href="{{ .Permalink }}">{{ .Params.title | humanize | title }}</a></li>
  {{ end }}
</ul>

```

The issue here is that the resulting display results in no pages. If I change the value of `$section` to be ‘pages’ then I get output, but not of the directory I am interested in.

Can anyone suggest what I should be doing?

---

<div class="post-metadata">

### Author: ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)
#### Post date: [June 30, 2021, 8:06pm UTC](https://discourse.gohugo.io/t/listing-files-only-from-given-section/33631/2 "2021-06-30T20:06:55Z")

</div>

```auto
{{ $section := "job-openings" }}

```

---

<div class="post-metadata">

### Author: ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)
#### Post date: [September 13, 2024, 3:44pm UTC](https://discourse.gohugo.io/t/listing-files-only-from-given-section/33631/3 "2024-09-13T15:44:43Z")

</div>

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