# Displaying Pinned Articles at the Top of the List While Using A Theme

**URL:** <https://discourse.gohugo.io/t/displaying-pinned-articles-at-the-top-of-the-list-while-using-a-theme/53486>\
**Category:** Using Themes\
**Tags:** pagination\
**Created:** [February 11, 2025, 9:34am UTC](https://discourse.gohugo.io/t/displaying-pinned-articles-at-the-top-of-the-list-while-using-a-theme/53486 "2025-02-11T09:34:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![valexand](https://avatars.discourse-cdn.com/v4/letter/v/74df32/32.png) [@valexand](https://discourse.gohugo.io/u/valexand)\
**Post date:** [February 11, 2025, 9:34am UTC](https://discourse.gohugo.io/t/displaying-pinned-articles-at-the-top-of-the-list-while-using-a-theme/53486/1 "2025-02-11T09:34:56Z")

</div>

Hi everyone,

I’m working on a Hugo site using the **Hugo Blog Awesome** theme, and I want certain articles to always appear at the top of the list when they have the `pinned: true` parameter.

All my articles are organized in subfolders, each containing an `index.md` file:

```css
content/
├── article-1/
│ ├── index.md (← This is the article file)
├── article-2/
│ ├── index.md

```

I added `pinned: true` to my articles, like this (comments not in code):

```yaml
---
title: "Relationship Between Orders: From 1830 to Today"
date: 2025-02-11
author: "Lövbacken"
pinned: true
description: "Chronological Timeline"
---

```

I modified my `list.html` in `layouts/_default/list.html`to try and display pinned articles first:

```go
{{ define "main" }}
<div class="wrapper list-page">
    <header class="header">
        <h1 class="header-title center">{{ .Title }}</h1>
    </header>
    <main class="page-content" aria-label="Content">

       // Pinned articles
        {{ $pinnedPosts := where .Site.RegularPages "Params.pinned" true }}
        {{ if $pinnedPosts }}
            <h2 class="post-year">📌 Pinned Articles</h2>
            {{ range $pinnedPosts }}
                {{ partial "postCard" . }}
            {{ end }}
        {{ end }}

        // Article by years
        {{ range .Site.RegularPages.GroupByDate "2006" }}
        {{ $year := .Key }}
        <h2 class="post-year">{{ $year }}</h2>

        {{ range where .Pages "Params.pinned" "!=" true }}
            {{ partial "postCard" . }}
        {{ end }}

        {{ end }}

    </main>
</div>
{{ end }}

```

- The articles **do not appear in the “📌 Pinned Articles” section** , even though `pinned: true` is set in the front matter.
- I tried using `.Site.RegularPages` and then `.Site.Pages`, but neither worked.

Am i doing anything wrong ?  
Thanks in advance for your help

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [February 11, 2025, 10:36am UTC](https://discourse.gohugo.io/t/displaying-pinned-articles-at-the-top-of-the-list-while-using-a-theme/53486/2 "2025-02-11T10:36:07Z")

</div>

> [@valexand](#):
>
> `where .Site.RegularPages "Params.pinned" true`

returns a value of the Pages Params map, so I would guess your frontmatter should be:

```yaml
---
title: "Relationship Between Orders: From 1830 to Today"
date: 2025-02-11
author: "Lövbacken"
description: "Chronological Timeline"
params:
  pinned: true
---

```

custom parameters in the global space are deprecated. always use the `params: map`

also the author should be moved there or replaced with taxonomies, but that would be needed to be supported by the theme.
