# Exclude pages with a given param from list layout

**URL:** https://discourse.gohugo.io/t/exclude-pages-with-a-given-param-from-list-layout/56170
**Category:** support
**Created:** [October 28, 2025, 9:12pm UTC](https://discourse.gohugo.io/t/exclude-pages-with-a-given-param-from-list-layout/56170 "2025-10-28T21:12:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Polarhardboiled](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/polarhardboiled/32/22623_2.png) [@Polarhardboiled](https://discourse.gohugo.io/u/Polarhardboiled)
#### Post date: [October 28, 2025, 9:12pm UTC](https://discourse.gohugo.io/t/exclude-pages-with-a-given-param-from-list-layout/56170/1 "2025-10-28T21:12:23Z")

</div>

I have a list layout as follows:

```auto
{{- $pages := union .RegularPages .Sections -}}
{{- if .IsHome -}}
{{- $pages = .Sections -}}
{{- end -}}

{{- $paginator := .Paginate $pages -}}
{{- range $index, $page := $paginator.Pages -}}
<ul class="undecorated">
  <li><a href="{{- .Permalink -}}">
    {{ partial "posts/post_thumb.html" . -}}
    <div class="info"><span>{{- .Title -}}</span>
    {{- if .Description -}}<span>{{- .Description -}}</span>{{ end }}
    <time>{{- .Date | time.Format ":date_medium" -}}</time></div></a>
  </li>
</ul>
{{- end -}}

```

I would like to exclude from this list pages with `.Params.format `eq docs as stated in frontmatter as:

```auto
---
title: links
tags: ['docs', 'développement', 'markdown']
format: doc
---

```

It should be also select from `tags: docs`

thank you

---

<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: [October 29, 2025, 1:12am UTC](https://discourse.gohugo.io/t/exclude-pages-with-a-given-param-from-list-layout/56170/2 "2025-10-29T01:12:14Z")

</div>

Search the documentation for “collections.Where”

---

<div class="post-metadata">

### Author: ![Polarhardboiled](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/polarhardboiled/32/22623_2.png) [@Polarhardboiled](https://discourse.gohugo.io/u/Polarhardboiled)
#### Post date: [October 31, 2025, 12:18pm UTC](https://discourse.gohugo.io/t/exclude-pages-with-a-given-param-from-list-layout/56170/3 "2025-10-31T12:18:47Z")

</div>

Thanks for the guidance.

I changed for `{{- $pages := union (where page.Pages "Params.tags" "ne" "docs") .Sections -}}`

---

<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: [November 2, 2025, 12:19pm UTC](https://discourse.gohugo.io/t/exclude-pages-with-a-given-param-from-list-layout/56170/4 "2025-11-02T12:19:14Z")

</div>

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