]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Revert "added the targetpage hook"
authorintrigeri <intrigeri@boum.org>
Sun, 2 Nov 2008 17:34:10 +0000 (18:34 +0100)
committerintrigeri <intrigeri@boum.org>
Sun, 2 Nov 2008 17:34:10 +0000 (18:34 +0100)
This reverts commit fc299df955879bf958aa78338ba64d56a7df17a9.
Such functionality can now be achieved using the inject() function.

Signed-off-by: intrigeri <intrigeri@boum.org>
IkiWiki.pm
IkiWiki/Plugin/skeleton.pm.example
doc/plugins/write.mdwn

index 8b3a911143934b0fe6acf674edf6b18e2bbc84d1..bab7b707aa6c485338fb3b863760e8019cd65e1c 100644 (file)
@@ -655,19 +655,8 @@ sub newpagefile ($$) { #{{{
 sub targetpage ($$) { #{{{
        my $page=shift;
        my $ext=shift;
-
-       my $targetpage='';
-       run_hooks(targetpage => sub {
-               $targetpage=shift->(
-                       page => $page,
-                       ext => $ext,
-               );
-       });
-
-       if (defined $targetpage && (length($targetpage) > 0)) {
-               return $targetpage;
-       }
-       elsif (! $config{usedirs} || $page eq 'index') {
+       
+       if (! $config{usedirs} || $page eq 'index') {
                return $page.".".$ext;
        }
        else {
index af22b340659bd72067c1cd552e69c221dd7ab364..f844ddb91ddaa96680094d792df96af2ddd4a229 100644 (file)
@@ -34,7 +34,6 @@ sub import { #{{{
        hook(type => "formbuilder_setup", id => "skeleton", call => \&formbuilder_setup);
        hook(type => "formbuilder", id => "skeleton", call => \&formbuilder);
        hook(type => "savestate", id => "skeleton", call => \&savestate);
-       hook(type => "targetpage", id => "skeleton", call => \&targetpage);
 } # }}}
 
 sub getopt () { #{{{
@@ -205,8 +204,4 @@ sub savestate () { #{{{
        debug("skeleton plugin running in savestate");
 } #}}}
 
-sub targetpage () { #{{{
-       debug("skeleton plugin running in targetpage");
-} #}}}
-
 1
index e8ac9614b4335cd6203853473e289c2c1b8a5115..abcabbdc39e43871af4b491b47b1540fda99a34f 100644 (file)
@@ -427,15 +427,6 @@ describes the plugin as a whole. For example:
   and undef if a rebuild could be needed in some circumstances, but is not
   strictly required.
 
-### targetpage
-
-       hook(type => "targetpage", id => "foo", call => \&targetpage);
-
-This hook can be used to override the name of the file a page should
-be compiled into. 
-
-It should return the target filename.
-
 ## Plugin interface
 
 To import the ikiwiki plugin interface: