Handlebars - Filter post by title


I want to filter my post by title (or url), but it doesn’t work. How should I proceed?

{{#get "posts" filter="title:{title}"}}

I tried multiple combinations but none of them worked!


Try slug. That’s the last part of the path name, so “My First Post” slugifies as my-first-post. (You can change the slug if you don’t like the defaults in the right pull-out menu.)

So it’d be {{#get "posts" filter="slug:{{somevariable}}" }} if you wanted to sub in a value, or {{#get "posts" filter="slug:my-first-post"}} if you’re after a specific post name.