]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/meta.pm
increase plugin interface to 1.02
[ikiwiki.git] / IkiWiki / Plugin / meta.pm
index 5bcd658378f37c630fe4b389f7bf25dfc95faeb7..5867329afd74ed0c2b94df12caad61d6d19a50ab 100644 (file)
@@ -13,7 +13,7 @@ my %author;
 my %authorurl;
 
 sub import { #{{{
-       hook(type => "preprocess", id => "meta", call => \&preprocess);
+       hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
        hook(type => "filter", id => "meta", call => \&filter);
        hook(type => "pagetemplate", id => "meta", call => \&pagetemplate);
 } # }}}
@@ -61,6 +61,13 @@ sub preprocess (@) { #{{{
                $permalink{$page}=$value;
                $meta{$page}.="<link rel=\"bookmark\" href=\"".encode_entities($value)."\" />\n";
        }
+       elsif ($key eq 'date') {
+               eval q{use Date::Parse};
+               if (! $@) {
+                       my $time = str2time($value);
+                       $IkiWiki::pagectime{$page}=$time if defined $time;
+               }
+       }
        else {
                $meta{$page}.="<meta name=\"".encode_entities($key).
                        "\" content=\"".encode_entities($value)."\" />\n";