I have a bunch of posts that the tag ends with ‘-series’ to denote that post is part of a series of posts. I am trying to create a page that will show all posts that are in a series.
I tried setting up a debugging section of my page to help me understand how the #match helper works. This is what I have:
<div style="background: #fff; padding: 1rem; margin: 1rem; border: 2px solid red;">
<h3>TEST 2: All tags with match helper "~$" "-series"</h3>
{{#get "tags" filter="visibility:public" limit="all"}}
<ul>
{{#foreach tags}}
<li>{{name}} ({{slug}})
{{#match slug "~$" "-series"}}
<strong style="color: green;">✓ ENDS WITH -series</strong>
{{else}}
<span style="color: red;">✗ does not end with -series</span>
{{/match}}
</li>
{{/foreach}}
</ul>
{{/get}}
</div>
This is what is displayed:
TEST 2: All tags with match helper “~$” “-series”
homeschooling-series (homeschooling-series) ✗ does not end with -series
making-kombucha-series (making-kombucha-series) ✗ does not end with -series
projects (projects) ✗ does not end with -series
I’ve tried matching on the name, slug, and tag values, but it never find the posts with the correct tag in it.
I think my logic might be getting mixed up somewhere, but I cant wrap my head around it.
Just for clarity I made sure I did actually have posts with the correct tag.
Edit: Ghost Version 5.46