]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/pagetemplate.pm
img: Add a margin around images displayed by this directive.
[ikiwiki.git] / IkiWiki / Plugin / pagetemplate.pm
index 205f5a9d77b13ce34b6b30d7d528f7658315df09..1d8a84ca77726d5d8486fc632b2606b98e25b5f6 100644 (file)
@@ -3,16 +3,25 @@ package IkiWiki::Plugin::pagetemplate;
 
 use warnings;
 use strict;
-use IkiWiki 2.00;
+use IkiWiki 3.00;
 
 my %templates;
 
-sub import { #{{{
+sub import {
+       hook(type => "getsetup", id => "pagetemplate", call => \&getsetup);
        hook(type => "preprocess", id => "pagetemplate", call => \&preprocess);
        hook(type => "templatefile", id => "pagetemplate", call => \&templatefile);
-} # }}}
+}
 
-sub preprocess (@) { #{{{
+sub getsetup () {
+       return 
+               plugin => {
+                       safe => 1,
+                       rebuild => undef,
+               },
+}
+
+sub preprocess (@) {
        my %params=@_;
 
        if (! exists $params{template} ||
@@ -26,9 +35,9 @@ sub preprocess (@) { #{{{
        }
 
        return "";
-} # }}}
+}
 
-sub templatefile (@) { #{{{
+sub templatefile (@) {
        my %params=@_;
 
        if (exists $templates{$params{page}}) {
@@ -36,6 +45,6 @@ sub templatefile (@) { #{{{
        }
        
        return undef;
-} # }}}
+}
 
 1