# Get name of each post in each category

**URL:** <https://talk.jekyllrb.com/t/get-name-of-each-post-in-each-category/5646>\
**Category:** Help\
**Created:** [February 16, 2021, 12:53am UTC](https://talk.jekyllrb.com/t/get-name-of-each-post-in-each-category/5646 "2021-02-16T00:53:12Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dsbarnes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/dsbarnes/32/3252_2.png) [@dsbarnes](https://talk.jekyllrb.com/u/dsbarnes)\
**Post date:** [February 16, 2021, 1:10pm UTC](https://talk.jekyllrb.com/t/get-name-of-each-post-in-each-category/5646/4 "2021-02-16T13:10:58Z")

</div>

You are the best!

Going to mark this as a solution, as that covers basically every question I came up with on this journey and more. (collection.docs … that is beautiful, and after as much digging should have been more obvious)

The rabbit I was ultimately looking to pull out of the hat was to change this:

```auto
{% for collection in site.collections %}
  {% assign name = collection.label %}
    <h1>{{ name }}</h1>
    {% for page in site.name %}
        <p>foo</p>
        <p>{{ page.title }}</p>
    {% endfor %}
{% endfor %}

```

to this:

```auto
{% for dir in site.collections %}
  {% assign collection = dir.label %}
    <h1>{{ collection }}</h1>
    {% for page in site[collection] %}
        <a href="{{ site.baseurl }}{{ page.url }}">{{ page.title }}</a>
    {% endfor %}
{% endfor %}

```

I’m not super familiar with liquid (er, obvs) and am not seeing, on either the [Shopify](https://shopify.dev/docs/themes/liquid/reference/objects) or [Github](https://shopify.github.io/liquid/basics/introduction/) docs the difference between “.” and “[]” (In fact in my quick-like skim through I didn’t see any references to “[]”'s at all)

So, why does that work?

And thanks a million Michael, I found the band site stumbling through other answers here. Super helpful.

---

_[View the full topic](https://talk.jekyllrb.com/t/get-name-of-each-post-in-each-category/5646)._
