Link list of pages by tags as a shortcode

To clarify, you don’t have a context problem.

<ul>
  {{ range where .Site.Pages "Params.tags" "intersect" (slice (.Get 0)) }}
    <li>
      <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
    </li>
  {{ end }}
</ul>

Call it with:

{{< pages-with-tag foo >}}

The reason it didn’t work for you, I suspect, is that some/all of your front matter tags fields are scalar instead of arrays.

You must do this:

tags = ['foo']

Not this:

tags = 'foo'

Try it:

git clone --single-branch -b hugo-forum-topic-48427 https://github.com/jmooring/hugo-testing hugo-forum-topic-48427
cd hugo-forum-topic-48427
hugo server