<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <id><%= config.url %></id>
    <title><%= config.title %><%= tag ? ` • Posts by "${tag}" tag` : '' %><%= category ? ` • Posts by "${category}" category` : '' %></title>
    <link href="<%= config.url %>" />
    <updated><%= moment(lastBuildDate).toISOString() %></updated>
    <%_ for (const { name } of (tags || [])) { _%>
    <category term="<%= name %>" />
    <%_ } _%>
    <%_ for (const post of posts) { _%>
    <entry>
        <id><%= post.permalink %></id>
        <title><%= post.title %></title>
        <link rel="alternate" href="<%= post.permalink %>"/>
        <content type="html"><%= post.content %></content>
        <%_ for (const { name } of (post.tags ? post.tags.toArray() : [])) { _%>
        <category term="<%= name %>" />
        <%_ } _%>
        <updated><%= moment(post.date).toISOString() %></updated>
    </entry>
    <%_ } _%>
</feed>
