# Empty section condition?

**URL:** <https://discourse.gohugo.io/t/empty-section-condition/8091>\
**Category:** support\
**Created:** [August 23, 2017, 12:17pm UTC](https://discourse.gohugo.io/t/empty-section-condition/8091 "2017-08-23T12:17:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptrvrhvn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ptrvrhvn/32/4007_2.png) [@ptrvrhvn](https://discourse.gohugo.io/u/ptrvrhvn)\
**Post date:** [August 23, 2017, 12:17pm UTC](https://discourse.gohugo.io/t/empty-section-condition/8091/1 "2017-08-23T12:17:23Z")

</div>

I’ve got 2 section folders filled with (only) drafts for future expansion. I list all sections in the navigation and on the front page, can I filter out those “empty” sections somehow?

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [August 23, 2017, 2:43pm UTC](https://discourse.gohugo.io/t/empty-section-condition/8091/2 "2017-08-23T14:43:06Z")

</div>

You can filter them out by setting a custom parameter on the `_index.md` of these sections.

Something like this would do. (This is in YAML you can figure out the TOML)

> `exclude: true`

And then simply place the following in the relevant template to exclude these sections from your navigation.

> ```
> {{ $sections := .Site.GetPage "section" .Section }}
> {{ range where $sections "Params.exclude" "ne" "true" }}
> 
> ```

EDIT  
I changed the above snippet because what I posted originally is meant for Nested Sections.
