I’m trying to add two post lists to the post page: popular posts (selected by internal tag #trending) and related posts (selected by tags of current post, but excluding any posts from the first section). I tried this:
<h3>Popular</h3>
<div class="post-feed">
{{#get "posts" limit="3" filter="tags:[hash-trending]+tags:-[{{tags[*].slug}}]+id:-{{id}}" include="tags" as |popular| }}
{{#foreach popular}}
{{> "post-card"}}
{{/foreach}}
{{/get}}
</div>
<h3>Related</h3>
<div class="post-feed">
{{#get "posts" limit="3" filter="tags:[{{tags[*].slug}}]+tag:-[hash-trending]+id:-{{id}}" include="tags" as |related| }}
{{#foreach related}}
{{> "post-card"}}
{{/foreach}}
{{/get}}
</div>
But I find it that tags
includes internal tags which often results in empty lists.
Can I select posts that share tags with current post but excluding any internal tags? Or better still, excluding selected tags?