--- layout: layouts/base.njk pagination: data: collections.tagList size: 1 alias: tag addAllPagesToCollections: true permalink: /tags/{{ tag | slug }}/ eleventyComputed: title: "Posts tagged '{{ tag }}'" ---

Posts tagged #{{ tag }}

{% set currentSlug = (tag | slug) %} {% set taggedPosts = [] %} {% for post in collections.posts %} {% set matched = false %} {% if post.data.tags %} {% for t in post.data.tags %} {% if (t | slug) == currentSlug %} {% set matched = true %} {% endif %} {% endfor %} {% endif %} {% if matched %} {% set taggedPosts = (taggedPosts.push(post), taggedPosts) %} {% endif %} {% endfor %} {% if taggedPosts.length > 0 %}
{% for post in taggedPosts %}

{{ post.data.title }}

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

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

No posts found with this tag.

{% endif %}