[% USE df = DateTime::Format('DateTime::Format::Strptime',
{ pattern => '%FT%T',
locale => 'en_US',
time_zone => 'GMT' }) -%]
[% USE Dumper -%]
[% tag='';
IF (matches = path.match('^(?:.*/)?tags/(.*)$'));
tag = matches.0;
END;
all_docs=changed.nsortf('last_change');
docs=[];
FOR doc IN all_docs;
NEXT UNLESS isLang(language,doc);
NEXT IF doc.match('^(?:.*/)?tags/(.*)$');
IF tag;
doc_duxml=typedAs(doc,'du.xml');
IF tagged.$tag.grep(doc_duxml).size == 0; # bad regex...
NEXT;
END;
END;
docs.push(doc);
END;
CALL docs.splice(0,-10);
-%]
<?xml version="1.0" encoding="utf-8"?>
<a:feed xmlns:a="http://www.w3.org/2005/Atom">
<a:id>tag:thenautilus.net,2009-08-18:tags/[% tag %]/feed.[% language %].xml</a:id>
[% IF docs.size > 0 -%]
<a:updated>[% l=docs.last;df.format(changed.$l.last_change) %]Z</a:updated>
[% END -%]
[% FOR doc IN docs -%]
<a:entry>
[% IF changed.$doc.creation %]<a:published>[% df.format(changed.$doc.creation) %]Z</a:published>[% END %]
[% IF changed.$doc.last_change %]<a:updated>[% df.format(changed.$doc.last_change) %]Z</a:updated>[% END %]
<a:id>tag:thenautilus.net,2009-08-18:[% atomIdFor(language,filename,dstUriFor(doc,filename)) %]</a:id>
<a:PH>[% dstUriFor(doc,filename) %]</a:PH>
</a:entry>
[% END -%]
</a:feed>