From fc7a4a1bc40e762697817a7a3a768bc1b7fa7864 Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 18 Aug 2009 15:02:15 +0200 Subject: adding feeds --- templates/base-feed.tt | 26 ++++++++++++++++++++++ templates/fillFeed.xsl | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 templates/base-feed.tt create mode 100644 templates/fillFeed.xsl (limited to 'templates') diff --git a/templates/base-feed.tt b/templates/base-feed.tt new file mode 100644 index 0000000..a7b34a3 --- /dev/null +++ b/templates/base-feed.tt @@ -0,0 +1,26 @@ +[% USE df = DateTime::Format('DateTime::Format::Strptime', + { pattern => '%FT%T', + locale => 'en_US', + time_zone => 'GMT' }) -%] +[% USE Dumper -%] +[% docs=changed.nsortf('last_change') -%] +[% tag='';IF (matches = path.match('^(?:.*/)?tags/(.*)$')); tag = matches.0; END -%] + + +[% tag %] ( [% path %] ) +[% l=docs.last;df.format(changed.$l.last_change) %]Z +[% FOR doc IN docs; NEXT UNLESS isLang(language,doc) -%] +[% IF tag; + doc_duxml=typedAs(doc,'du.xml'); + IF tagged.$tag.grep(doc_duxml).size == 0; # bad regex... + NEXT; + END; + END -%] + + [% IF changed.$doc.creation %][% df.format(changed.$doc.creation) %]Z[% END %] + [% IF changed.$doc.last_change %][% df.format(changed.$doc.last_change) %]Z[% END %] + tag:thenautilus.net,2009-08-18:[% atomIdFor(language,filename,dstUriFor(doc,filename)) %] + [% dstUriFor(doc,filename) %] + +[% END -%] + diff --git a/templates/fillFeed.xsl b/templates/fillFeed.xsl new file mode 100644 index 0000000..593ff51 --- /dev/null +++ b/templates/fillFeed.xsl @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + Gianni Ceccarelli + dakkar@thenautilus.net + + http://www.thenautilus.net/ + + thenautilus.net + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
+
+ + + + + +
+ +
\ No newline at end of file -- cgit v1.2.3