diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-01-26 20:05:36 -0500 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-01-26 20:05:36 -0500 |
commit | 848ff1bf5e218c57cc738a85ed02d7e1396c1d22 (patch) | |
tree | 70819d0984c9c52c556b7b282ceffa4ad08eeccb /IkiWiki/Plugin | |
parent | 1f3f33fa67ade3bbc219f5bdc4f8e411162f3f28 (diff) | |
parent | c89925048f6c0b149d09b76ff122da2205b6ec86 (diff) |
Merge commit 'smcv/updated'
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 12 | ||||
-rw-r--r-- | IkiWiki/Plugin/meta.pm | 7 |
2 files changed, 16 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index d8b5f8548..2205ebffc 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -519,9 +519,15 @@ sub genfeed ($$$$$@) { mdate_3339 => date_3339($pagemtime{$p}), ); - if (exists $pagestate{$p} && - exists $pagestate{$p}{meta}{guid}) { - $itemtemplate->param(guid => $pagestate{$p}{meta}{guid}); + if (exists $pagestate{$p}) { + if (exists $pagestate{$p}{meta}{guid}) { + $itemtemplate->param(guid => $pagestate{$p}{meta}{guid}); + } + + if (exists $pagestate{$p}{meta}{updated}) { + $itemtemplate->param(mdate_822 => date_822($pagestate{$p}{meta}{updated})); + $itemtemplate->param(mdate_3339 => date_3339($pagestate{$p}{meta}{updated})); + } } if ($itemtemplate->query(name => "enclosure")) { diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index 15bb29b3f..4a22fed30 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -128,6 +128,13 @@ sub preprocess (@) { $IkiWiki::pagectime{$page}=$time if defined $time; } } + elsif ($key eq 'updated') { + eval q{use Date::Parse}; + if (! $@) { + my $time = str2time($value); + $pagestate{$page}{meta}{updated}=$time if defined $time; + } + } if (! defined wantarray) { # avoid collecting duplicate data during scan pass |