]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/correct_published_and_updated_time_information_for_the_feeds.mdwn
comments and review
[ikiwiki.git] / doc / bugs / correct_published_and_updated_time_information_for_the_feeds.mdwn
1 In [Atom](http://www.ietf.org/rfc/rfc4287.txt), we can provide `published` and `updated` information.
2 In [RSS](http://cyber.law.harvard.edu/rss/rss.html), there is only `pubDate`, for the 
3 publication date, but an update can be mentioned with the [`dc:modified`](http://www.ietf.org/rfc/rfc2413.txt) 
4 element (whose datetime format is [iso 8601](http://www.w3.org/TR/NOTE-datetime)). 
5 This patch updates :) `inline.pm` and the two relevant templates.
6
7     --- inline.pm.orig      2007-08-07 05:44:26.000000000 +0200
8     +++ inline.pm   2007-08-07 05:47:37.000000000 +0200
9     @@ -362,7 +362,9 @@
10                             url => $u,
11                             permalink => $u,
12                             date_822 => date_822($pagectime{$p}),
13     +                       mdate_822 => date_822($pagemtime{$p}),
14                             date_3339 => date_3339($pagectime{$p}),
15     +                       mdate_3339 => date_3339($pagemtime{$p}),
16                     );
17      
18                     if ($itemtemplate->query(name => "enclosure")) {
19     @@ -397,7 +399,7 @@
20                     $content.=$itemtemplate->output;
21                     $itemtemplate->clear_params;
22      
23     -               $lasttime = $pagectime{$p} if $pagectime{$p} > $lasttime;
24     +               $lasttime = $pagemtime{$p} if $pagemtime{$p} > $lasttime;
25             }
26      
27             my $template=template($feedtype."page.tmpl", blind_cache => 1);
28     --- atomitem.tmpl.orig  2007-08-07 05:44:43.000000000 +0200
29     +++ atomitem.tmpl       2007-08-07 05:46:14.000000000 +0200
30     @@ -11,7 +11,8 @@
31             <category term="<TMPL_VAR CATEGORY>" />
32             </TMPL_LOOP>
33             </TMPL_IF>
34     -       <updated><TMPL_VAR DATE_3339></updated>
35     +       <updated><TMPL_VAR MDATE_3339></updated>
36     +       <published><TMPL_VAR DATE_3339></published>
37             <TMPL_IF NAME="ENCLOSURE">
38             <link rel="enclosure" type="<TMPL_VAR TYPE>" href="<TMPL_VAR ENCLOSURE>" length="<TMPL_VAR LENGTH>" />
39             <TMPL_ELSE>
40     --- rssitem.tmpl.orig   2007-08-07 05:44:58.000000000 +0200
41     +++ rssitem.tmpl        2007-08-07 06:06:36.000000000 +0200
42     @@ -5,6 +5,7 @@
43             <TMPL_ELSE>
44             <title><TMPL_VAR TITLE></title>
45             </TMPL_IF>
46     +       <dc:modified><TMPL_VAR MDATE_3339></dc:modified>
47             <guid><TMPL_VAR URL></guid>
48             <link><TMPL_VAR PERMALINK></link>
49             <TMPL_IF NAME="CATEGORIES">
50
51 — NicolasLimare
52
53 [[tag patch]]