# Hugo 101: how to select a page based on a tag

**URL:** <https://discourse.gohugo.io/t/hugo-101-how-to-select-a-page-based-on-a-tag/17168>\
**Category:** support\
**Created:** [February 22, 2019, 10:56pm UTC](https://discourse.gohugo.io/t/hugo-101-how-to-select-a-page-based-on-a-tag/17168 "2019-02-22T22:56:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawsys](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pawsys/32/7949_2.png) [@pawsys](https://discourse.gohugo.io/u/pawsys)\
**Post date:** [February 22, 2019, 10:56pm UTC](https://discourse.gohugo.io/t/hugo-101-how-to-select-a-page-based-on-a-tag/17168/1 "2019-02-22T22:56:28Z")

</div>

I am just beginning with Hugo and Go. I want to do a pretty simple thing and can’t figure it out. In a list page – I want to style pages with “link” tag differently. How to select the pages that have a specific tag. I tried to do it this way:

```
{{range .Pages}}
{{ $tag := .Params.Tags }}
{{ if eq $tag "link" }}
  <p>Print something else</p>
  <hr>
{{else}}
  <h3><a href="{{.URL}}">{{.Title}}</a></h3>
  {{.Content}}
  <p>{{.Params.tags}}</p>
  <p>{{.Params.types}}</p>
  <hr>
{{end}}
{{end}}

```

Variables are super confusing. I don’t understand what the dot {{.}} is doing. Why sometimes you should capitalize the first letter why sometimes you shouldn’t. I went through Giraffe Academy tutorials and read some documentation. Is there a good place for me to learn this give that I am new to the frontend world?

---

<div class="post-metadata">

**Author:** ![regis](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/regis/32/4958_2.png) [@regis](https://discourse.gohugo.io/u/regis)\
**Post date:** [February 22, 2019, 11:51pm UTC](https://discourse.gohugo.io/t/hugo-101-how-to-select-a-page-based-on-a-tag/17168/2 "2019-02-22T23:51:07Z")

</div>

For your first question:

`.Params.tags` will return a slice of strings (array), it’s a list of tags associated with the page.

So you could use the [`in`](https://gohugo.io/functions/in/#readout) function, (`if in .Params.tags "link"`)

For your second question, this post should give you more context on the dot etc…: [https://regisphilibert.com/blog/2018/02/hugo-the-scope-the-context-and-the-dot/](https://regisphilibert.com/blog/2018/02/hugo-the-scope-the-context-and-the-dot/)
