From 7c173aca3e87d13fdd044cb79dac80ad83d64a38 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 2 Nov 2008 18:08:50 +0100 Subject: Revert "added hook urlpath" and "rename urlpath hook into tweakurlpath..." This reverts commits d9b9022c13af3aa6c469df05beaa293fcf33cafc and 39d44d443d2271ec8787e6192b8b5811bee41ebf. This functionality should now be achieved using the new inject() function. Signed-off-by: intrigeri --- IkiWiki/Plugin/skeleton.pm.example | 5 ----- 1 file changed, 5 deletions(-) (limited to 'IkiWiki/Plugin/skeleton.pm.example') diff --git a/IkiWiki/Plugin/skeleton.pm.example b/IkiWiki/Plugin/skeleton.pm.example index ecf2a2407..af22b3406 100644 --- a/IkiWiki/Plugin/skeleton.pm.example +++ b/IkiWiki/Plugin/skeleton.pm.example @@ -35,7 +35,6 @@ sub import { #{{{ hook(type => "formbuilder", id => "skeleton", call => \&formbuilder); hook(type => "savestate", id => "skeleton", call => \&savestate); hook(type => "targetpage", id => "skeleton", call => \&targetpage); - hook(type => "urlpath", id => "skeleton", call => \&urlpath); } # }}} sub getopt () { #{{{ @@ -210,8 +209,4 @@ sub targetpage () { #{{{ debug("skeleton plugin running in targetpage"); } #}}} -sub urlpath () { #{{{ - debug("skeleton plugin running in urlpath"); -} #}}} - 1 -- cgit v1.2.3 From 439a2d3c443a032b26ce2455c6f15352a7e606be Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 2 Nov 2008 18:34:10 +0100 Subject: Revert "added the targetpage hook" This reverts commit fc299df955879bf958aa78338ba64d56a7df17a9. Such functionality can now be achieved using the inject() function. Signed-off-by: intrigeri --- IkiWiki.pm | 15 ++------------- IkiWiki/Plugin/skeleton.pm.example | 5 ----- doc/plugins/write.mdwn | 9 --------- 3 files changed, 2 insertions(+), 27 deletions(-) (limited to 'IkiWiki/Plugin/skeleton.pm.example') diff --git a/IkiWiki.pm b/IkiWiki.pm index 8b3a91114..bab7b707a 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -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 { diff --git a/IkiWiki/Plugin/skeleton.pm.example b/IkiWiki/Plugin/skeleton.pm.example index af22b3406..f844ddb91 100644 --- a/IkiWiki/Plugin/skeleton.pm.example +++ b/IkiWiki/Plugin/skeleton.pm.example @@ -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 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index e8ac9614b..abcabbdc3 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -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: -- cgit v1.2.3