]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/ddate.pm
Pass HTTPS variable through the wrapper so that CGI->https can be used by plugins...
[ikiwiki.git] / IkiWiki / Plugin / ddate.pm
index d081cb5094d56b5030ba54f7504d911785000643..6c36de0a6b120b6047c44cca610bcd5e80333c29 100644 (file)
@@ -6,14 +6,15 @@ use IkiWiki 2.00;
 no warnings;
 
 sub import { #{{{
-       hook(type => "checkconfig", id => "ddate", call => \&checkconfig);
+       hook(type => "getsetup", id => "ddate", call => \&getsetup);
 } # }}}
 
-sub checkconfig () { #{{{
-       if (! defined $config{timeformat} ||
-           $config{timeformat} eq '%c') {
-               $config{timeformat}='on %A, the %e of %B, %Y. %N%nCelebrate %H';
-       }
+sub getsetup { #{{{
+       return
+               plugin => {
+                       safe => 1,
+                       rebuild => 1,
+               },
 } #}}}
 
 sub IkiWiki::displaytime ($;$) { #{{{
@@ -21,6 +22,9 @@ sub IkiWiki::displaytime ($;$) { #{{{
        my $format=shift;
        if (! defined $format) {
                $format=$config{timeformat};
+               if ($format eq '%c') {
+                       $format='on %A, the %e of %B, %Y. %N%nCelebrate %H';
+               }
        }
        eval q{
                use DateTime;