1 diff -x {arch} -x .arch-ids -Nur ikiwiki--upstream--1.0--patch-26/IkiWiki/Plugin/inline.pm ikiwiki--devo--1.0--patch-9/IkiWiki/Plugin/inline.pm
2 --- ikiwiki--upstream--1.0--patch-26/IkiWiki/Plugin/inline.pm 2006-09-17 16:08:18.969109484 -0400
3 +++ ikiwiki--devo--1.0--patch-9/IkiWiki/Plugin/inline.pm 2006-09-16 13:38:36.336193934 -0400
13 my $raw=yesno($params{raw});
14 my $archive=yesno($params{archive});
15 my $rss=exists $params{rss} ? yesno($params{rss}) : 1;
16 + my $atom=exists $params{atom} ? yesno($params{atom}) : 1;
17 if (! exists $params{show} && ! $archive) {
21 add_depends($params{page}, $params{pages});
23 my $rssurl=rsspage(basename($params{page}));
24 + my $atomurl=atompage(basename($params{page}));
27 if (exists $params{rootpage} && $config{cgiurl}) {
30 $formtemplate->param(rssurl => $rssurl);
32 + if ($config{atom}) {
33 + $formtemplate->param(atomurl => $atomurl);
35 $ret.=$formtemplate->output;
37 elsif ($config{rss} && $rss) {
39 $linktemplate->param(rssurl => $rssurl);
40 $ret.=$linktemplate->output;
42 + elsif ($config{atom} && $atom) {
43 + # Add a Atom link button.
44 + my $linktemplate=template("atomlink.tmpl", blind_cache => 1);
45 + $linktemplate->param(atomurl => $atomurl);
46 + $ret.=$linktemplate->output;
49 my $template=template(
50 ($archive ? "inlinepagetitle.tmpl" : "inlinepage.tmpl"),
52 # only supports listing one file per page.
53 if ($config{rss} && $rss) {
54 writefile(rsspage($params{page}), $config{destdir},
55 - genrss($desc, $params{page}, @list));
56 + genfeed("rss", $rssurl, $desc, $params{page}, @list));
57 $toping{$params{page}}=1 unless $config{rebuild};
58 $rsslinks{$params{destpage}}=qq{<link rel="alternate" type="application/rss+xml" title="RSS" href="$rssurl" />};
60 + if ($config{atom} && $atom) {
61 + writefile(atompage($params{page}), $config{destdir},
62 + genfeed("atom", $atomurl, $desc, $params{page}, @list));
63 + $toping{$params{page}}=1 unless $config{rebuild};
64 + $atomlinks{$params{destpage}}=qq{<link rel="alternate" type="application/atom+xml" title="Atom" href="$atomurl" />};
71 $template->param(rsslink => $rsslinks{$page})
72 if exists $rsslinks{$page} && $template->query(name => "rsslink");
73 + $template->param(atomlink => $atomlinks{$page})
74 + if exists $atomlinks{$page} && $template->query(name => "atomlink");
77 sub get_inline_content ($$) { #{{{
82 +sub date_3339 ($) { #{{{
86 + my $lc_time= POSIX::setlocale(&POSIX::LC_TIME);
87 + POSIX::setlocale(&POSIX::LC_TIME, "C");
88 + my $ret=POSIX::strftime("%Y-%m-%dT%H:%M:%SZ", localtime($time));
89 + POSIX::setlocale(&POSIX::LC_TIME, $lc_time);
93 sub absolute_urls ($$) { #{{{
94 # sucky sub because rss sucks
100 -sub genrss ($$@) { #{{{
101 +sub atompage ($) { #{{{
104 + return $page.".atom";
107 +sub genfeed ($$$$@) { #{{{
108 + my $feedtype=shift;
114 my $url=URI->new(encode_utf8($config{url}."/".htmlpage($page)));
116 - my $itemtemplate=template("rssitem.tmpl", blind_cache => 1);
117 + my $itemtemplate=template($feedtype."item.tmpl", blind_cache => 1);
120 foreach my $p (@pages) {
121 next unless exists $renderedfiles{$p};
126 pubdate => date_822($pagectime{$p}),
127 + atompubdate => date_3339($pagectime{$p}),
128 content => absolute_urls(get_inline_content($p, $page), $url),
130 run_hooks(pagetemplate => sub {
131 @@ -241,15 +282,19 @@
133 $content.=$itemtemplate->output;
134 $itemtemplate->clear_params;
136 + $lasttime = $pagectime{$p};
139 - my $template=template("rsspage.tmpl", blind_cache => 1);
140 + my $template=template($feedtype."page.tmpl", blind_cache => 1);
142 title => $config{wikiname},
143 wikiname => $config{wikiname},
147 + feeddate => date_3339($lasttime),
148 + feedurl => $feedurl,
150 run_hooks(pagetemplate => sub {
151 shift->(page => $page, destpage => $page,
152 diff -x {arch} -x .arch-ids -Nur ikiwiki--upstream--1.0--patch-26/templates/atomitem.tmpl ikiwiki--devo--1.0--patch-9/templates/atomitem.tmpl
153 --- ikiwiki--upstream--1.0--patch-26/templates/atomitem.tmpl 1969-12-31 19:00:00.000000000 -0500
154 +++ ikiwiki--devo--1.0--patch-9/templates/atomitem.tmpl 2006-09-16 02:56:56.075533012 -0400
157 + <title><TMPL_VAR TITLE ESCAPE=HTML></title>
158 + <TMPL_IF NAME="AUTHOR">
159 + <author><TMPL_VAR AUTHOR ESCAPE=HTML></author>
162 + <id><TMPL_VAR URL></id>
163 + <link href="<TMPL_VAR PERMALINK>"/>
164 + <TMPL_IF NAME="CATEGORIES">
165 + <TMPL_LOOP NAME="CATEGORIES">
166 + <category><TMPL_VAR CATEGORY></category>
169 + <updated><TMPL_VAR ATOMPUBDATE></updated>
170 + <content type="xhtml" xml:lang="en">
171 + <div xmlns="http://www.w3.org/1999/xhtml">
172 + ![CDATA[<TMPL_VAR CONTENT>]]
176 diff -x {arch} -x .arch-ids -Nur ikiwiki--upstream--1.0--patch-26/templates/atomlink.tmpl ikiwiki--devo--1.0--patch-9/templates/atomlink.tmpl
177 --- ikiwiki--upstream--1.0--patch-26/templates/atomlink.tmpl 1969-12-31 19:00:00.000000000 -0500
178 +++ ikiwiki--devo--1.0--patch-9/templates/atomlink.tmpl 2006-09-16 02:56:56.079533423 -0400
181 +<TMPL_IF NAME="ATOMURL">
182 +<a class="atombutton" type="application/atom+xml" href="<TMPL_VAR NAME=ATOMURL>">Atom</a>
185 diff -x {arch} -x .arch-ids -Nur ikiwiki--upstream--1.0--patch-26/templates/atompage.tmpl ikiwiki--devo--1.0--patch-9/templates/atompage.tmpl
186 --- ikiwiki--upstream--1.0--patch-26/templates/atompage.tmpl 1969-12-31 19:00:00.000000000 -0500
187 +++ ikiwiki--devo--1.0--patch-9/templates/atompage.tmpl 2006-09-16 02:56:56.079533423 -0400
189 +<?xml version="1.0" encoding="utf-8"?>
191 +<feed xmlns="http://www.w3.org/2005/Atom">
192 + <title><TMPL_VAR TITLE ESCAPE=HTML></title>
193 + <link href="<TMPL_VAR PAGEURL>"/>
194 + <link href="<TMPL_VAR FEEDURL>" rel="self"/>
196 + <name>John Doe</name>
198 + <id><TMPL_VAR PAGEURL></id>
199 + <subtitle type="html"><TMPL_VAR RSSDESC ESCAPE=HTML></subtitle>
200 + <generator uri="http://ikiwiki.kitenet.net/" version="1.0">ikiwiki</generator>
201 + <updated><TMPL_VAR FEEDDATE></updated>