--- layout: layouts/base.njk pagination: data: collections.categoryList size: 1 alias: category addAllPagesToCollections: true permalink: /categories/{{ category | slug }}/ eleventyComputed: title: "Posts in '{{ category }}'" ---

Posts in {{ category }}

{% set catPosts = [] %} {% for post in collections.posts %} {% if post.data.category and post.data.category == category %} {% set catPosts = (catPosts.push(post), catPosts) %} {% endif %} {% endfor %} {% if catPosts.length > 0 %}
{% for post in catPosts %}

{{ post.data.title }}

{{ post.data.description or (post.templateContent | striptags | truncate(160)) }}

{% if post.data.tags %} {% for postTag in post.data.tags %} #{{ postTag }} {% endfor %} {% endif %}
{% endfor %}
{% else %}

No posts found in this category.

{% endif %}