---
pagination:
    data: collections.tags
    size: 1
    alias: tag
eleventyComputed:
    permalink: "/post/tag/{{ tag }}/atom.xml"
eleventyExcludeFromCollections: true
eleventyImport:
  collections: ["posts", "tags"]
---
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="/atom.xslt" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="{{ metadata.site.url }}">
  <title>{{ metadata.site.name }}</title>
  <subtitle>Posts tagged #{{ tag }}</subtitle>
  <link href="{{ permalink | absoluteUrl(metadata.site.url) }}" rel="self"/>
  <link href="{{ metadata.site.url }}" rel="alternate" />
  <updated>{{ collections.posts | getNewestCollectionItemDate | dateToRfc3339 }}</updated>
  <id>{{ metadata.site.url }}</id>
  <author>
    <name>{{ metadata.author.name }}</name>
    <uri>{{ metadata.site.url }}</uri>
  </author>
  <category term="{{ tag }}" />
  {%- for post in collections.tagPosts[tag] %}
  {%- set absolutePostUrl = post.url | absoluteUrl(metadata.site.url) %}
  <entry>
    <title>{{ post.data.title }}</title>
    <link href="{{ absolutePostUrl }}"/>
    <updated>{{ post.date | dateToRfc3339 }}</updated>
    <id>{{ absolutePostUrl }}</id>
    <content xml:lang="{{ metadata.site.language }}" type="html">{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) }}</content>
    <summary>{{ post | excerpt }}</summary>
  </entry>
  {%- endfor %}
</feed>