---
pagination:
    data: collections.tags
    size: 1
    alias: tag
eleventyComputed:
    permalink: "/post/tag/{{ tag }}/feed.json"
eleventyExcludeFromCollections: true
eleventyImport:
  collections: ["posts", "tags"]
---
{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "{{ metadata.site.name }}",
  "language": "{{ metadata.site.language }}",
  "home_page_url": "{{ metadata.site.url }}",
  "feed_url": "{{ permalink | absoluteUrl(metadata.site.url) }}",
  "description": "Posts tagged #{{ tag }}",
  "author": {
    "name": "{{ metadata.author.name }}",
    "url": "{{ metadata.site.url }}"
  },
  "items": [
    {%- for post in collections.tagPosts[tag] %}
    {%- set absolutePostUrl = post.url | absoluteUrl(metadata.site.url) %}
    {
      "id": "{{ absolutePostUrl }}",
      "url": "{{ absolutePostUrl }}",
      "title": "{{ post.data.title }}",
      "content_html": {% if post.templateContent %}{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) | dump | safe }}{% else %}""{% endif %},
      "date_published": "{{ post.date | dateToRfc3339 }}",
      "tags": {{ post.data.tags | except("posts") | json | safe }},
      "summary": {{ post | excerpt | json | safe }}
    }
    {% if not loop.last %},{% endif %}
    {%- endfor %}
  ]
}