Listing pages in single pages

I have the following list on my index page.

{{ range where $.Data.Pages “Section” “showcase” }}
{{ .Render “showcase-card” }}
{{ end }}

It works great allowing me to create an overview sidebar. So I then wanted to have it on all pages, including those showing a single showcase.

When I try to put it in a single.html it fails with the list being
It seems that it is in the context of the data for the single page, how can I do it in a site wide context?

I tried putting it in a partial template, but that seems to be in the same single showcase context.

probably need to use $.Site.Data.Pages ?

{{ range where $.Site.Data.Pages “Section” “showcase” }}

or

{{ range where .Site.Data.Pages “Section” “showcase” }}

or

{{ range (where $.Site.Data.Pages “Section” “showcase”) }}

This worked

{{ range (where $.Site.Pages "Section" "showcase") }}

that’s it.

ProTip: Remember that Data.Pages is technically an alias for .Site.Pages, but only for the homepage.