]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/patchqueue/meta_param_to_set_ctime.mdwn
web commit by JoshTriplett: Does discussion end up in examples?
[git.ikiwiki.info.git] / doc / patchqueue / meta_param_to_set_ctime.mdwn
1 It would be nice to backdate some posts, so they can be sorted easier "by 
2 hand" when the ctime of the actual file is not what you want.
4 The patch is [here](http://ikidev.betacantrips.com/patches/meta-date.patch).
6 You can see it in use [here](http://ikidev.betacantrips.com/metadate/).
8     diff -urX ignorepats ikiclean/IkiWiki/Plugin/meta.pm ikidev/IkiWiki/Plugin/meta.pm
9     --- ikiclean/IkiWiki/Plugin/meta.pm 2007-02-11 21:40:32.002000000 -0800
10     +++ ikidev/IkiWiki/Plugin/meta.pm   2007-02-12 07:44:11.182418000 -0800
11     @@ -5,6 +5,7 @@
12      use warnings;
13      use strict;
14      use IkiWiki;
15     +use Date::Parse;
16      
17      my %meta;
18      my %title;
19     @@ -61,6 +62,10 @@
20                 $permalink{$page}=$value;
21                 $meta{$page}.="<link rel=\"bookmark\" href=\"".encode_entities($value)."\" />\n";
22         }
23     +   elsif ($key eq 'date') {
24     +           my $time = str2time($value);
25     +           $IkiWiki::pagectime{$page}=$time;
26     +   }
27         else {
28                 $meta{$page}.="<meta name=\"".encode_entities($key).
29                         "\" content=\"".encode_entities($value)."\" />\n";