<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title><%= $site->title %></title>
        <link><%= $site->url( $self->page->path ) %></link>
        <atom:link href="<%= $site->url( $self->path ) %>" rel="self" type="application/rss+xml" />
        <description>Blog feed of <%= $site->title %></description>
        <generator>Statocles <%= $Statocles::VERSION %></generator>
        % for my $p ( @$pages ) {
        % my $doc = $p->document;
        <item>
            <title><%= $doc->title %></title>
            <link><%= $site->url( $p->path ) %></link>
            <guid><%= $site->url( $p->path ) %></guid>
            <description><![CDATA[
                % my @sections = $p->sections;
                <%= $sections[0] %>
                % if ( $doc->links->{crosspost} ) {
                    <ul>
                    % for my $link ( @{ $doc->links->{crosspost} } ) {
                        <li><a href="<%= $link->{href} %>">
                            Continue reading <em><%= $doc->title %></em> on <%= $link->{title} %>...
                        </a></li>
                    % }
                        <li><a href="<%= $site->url( $p->path ) %>#section-2">
                            Continue reading on <%= $site->title %>
                        </a></li>
                    </ul>
                % }
                % else {
                    <p><a href="<%= $site->url( $p->path ) %>#section-2">Continue reading...</a></p>
                % }
                <p>Tags:
                % for my $tag ( @{ $p->tags } ) {
                    <a href="<%= $tag->{href} %>"><%= $tag->{title} %></a>
                % }
                </p>
            ]]></description>
            <pubDate>
                <%= $p->published->strftime('%a, %d %b %Y %T %z') %>
            </pubDate>
        </item>
        % }
    </channel>
</rss>