I’d like to get the length of the count.posts, so I can display examples like this:
1 post
2 posts
So I tried this:
<div class="post-count">{{ count.posts }} post{{#if count.posts.length > 1}}s{{/if}}</div>
But unfortunately it doesn’t recognize .length
Does anyone know how I could do this?
The error I’m getting:
Parse error on line 41: … count.posts.length > 1}}s{{/if}} -----------------------^ Expecting ‘CLOSE_RAW_BLOCK’, ‘CLOSE’, ‘CLOSE_UNESCAPED’, ‘OPEN_SEXPR’, ‘CLOSE_SEXPR’, ‘ID’, ‘OPEN_BLOCK_PARAMS’, ‘STRING’, ‘NUMBER’, ‘BOOLEAN’, ‘UNDEFINED’, ‘NULL’, ‘DATA’, ‘SEP’, got ‘INVALID’