X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/2d3dc86d07a7ebf5f638084259ae2d9c2c63e6b6..419de149a6b4c1cf598f33f0c96a2a21104528ec:/IkiWiki/Plugin/ddate.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/ddate.pm b/IkiWiki/Plugin/ddate.pm index d081cb509..c73317b2f 100644 --- a/IkiWiki/Plugin/ddate.pm +++ b/IkiWiki/Plugin/ddate.pm @@ -6,21 +6,25 @@ 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 ($;$) { #{{{ +sub IkiWiki::formattime ($;$) { #{{{ my $time=shift; 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;