You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.3 KiB

%# RSS requires date/time in the 'C' locale as per RFC822. strftime() is one of
%# the few things that actually cares about locale.
% use POSIX qw(locale_h);
% my $current_locale = setlocale(LC_TIME);
% setlocale(LC_TIME, 'C');
<?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->links('alternate')->href) %></link>
<atom:link href="<%= $site->url($self->path) %>" rel="self" type="application/rss+xml" />
<description>Записи из <%= $site->title %></description>
<generator>Statocles <%= $Statocles::VERSION %></generator>
% for my $p (@$pages) {
<item>
<title><%= $p->title %></title>
<link><%= $site->url($p->path) %></link>
<guid><%= $site->url($p->path) %></guid>
<description><![CDATA[
% my @sections = $p->sections;
<%= $sections[0] %>
<p><a href="<%= $site->url($p->path) %>#section-2">Далее...</a></p>
<p>Теги:
% for my $tag ($p->tags) {
<a href="<%= $tag->href %>"><%= $tag->text %></a>
% }
</p>
]]></description>
<pubDate><%= $p->date->strftime('%a, %d %b %Y %H:%M:%S ') . sprintf q{%+05d}, $p->date->tzoffset / 36 %></pubDate>
</item>
% }
</channel>
</rss>
% setlocale(LC_TIME, $current_locale);