summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/link.pm4
-rw-r--r--IkiWiki/Plugin/rename.pm8
-rw-r--r--IkiWiki/Plugin/skeleton.pm.example14
3 files changed, 20 insertions, 6 deletions
diff --git a/IkiWiki/Plugin/link.pm b/IkiWiki/Plugin/link.pm
index 48691d973..b79273f96 100644
--- a/IkiWiki/Plugin/link.pm
+++ b/IkiWiki/Plugin/link.pm
@@ -12,7 +12,7 @@ sub import {
hook(type => "checkconfig", id => "link", call => \&checkconfig);
hook(type => "linkify", id => "link", call => \&linkify);
hook(type => "scan", id => "link", call => \&scan);
- hook(type => "renamelink", id => "link", call => \&renamelink);
+ hook(type => "renamepage", id => "link", call => \&renamepage);
}
sub getsetup () {
@@ -90,7 +90,7 @@ sub scan (@) {
}
}
-sub renamelink (@) {
+sub renamepage (@) {
my %params=@_;
my $page=$params{page};
my $old=$params{oldpage};
diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm
index b43c5282a..90af1b4a9 100644
--- a/IkiWiki/Plugin/rename.pm
+++ b/IkiWiki/Plugin/rename.pm
@@ -216,7 +216,7 @@ sub postrename ($;$$$) {
# Update edit form content to fix any links present
# on it.
$postrename->param("editcontent",
- renamelink_hook($dest, $src, $dest,
+ renamepage_hook($dest, $src, $dest,
$postrename->param("editcontent")));
# Get a new edit token; old was likely invalidated.
@@ -446,10 +446,10 @@ sub linklist {
} @{$list}]
}
-sub renamelink_hook ($$$$) {
+sub renamepage_hook ($$$$) {
my ($page, $src, $dest, $content)=@_;
- IkiWiki::run_hooks(renamelink => sub {
+ IkiWiki::run_hooks(renamepage => sub {
$content=shift->(
page => $page,
oldpage => $src,
@@ -506,7 +506,7 @@ sub fixlinks ($$$) {
if ($needfix) {
my $file=$pagesources{$page};
my $oldcontent=readfile($config{srcdir}."/".$file);
- my $content=renamelink_hook($page, $rename->{src}, $rename->{dest}, $oldcontent);
+ my $content=renamepage_hook($page, $rename->{src}, $rename->{dest}, $oldcontent);
if ($oldcontent ne $content) {
my $token=IkiWiki::rcs_prepedit($file);
eval { writefile($file, $config{srcdir}, $content) };
diff --git a/IkiWiki/Plugin/skeleton.pm.example b/IkiWiki/Plugin/skeleton.pm.example
index 6a97fb2f2..5fb391b0d 100644
--- a/IkiWiki/Plugin/skeleton.pm.example
+++ b/IkiWiki/Plugin/skeleton.pm.example
@@ -36,6 +36,8 @@ sub import {
hook(type => "editcontent", id => "skeleton", call => \&editcontent);
hook(type => "formbuilder_setup", id => "skeleton", call => \&formbuilder_setup);
hook(type => "formbuilder", id => "skeleton", call => \&formbuilder);
+ hook(type => "renamepage", id => "skeleton", call => \&renamepage);
+ hook(type => "rename", id => "skeleton", call => \&renamepages);
hook(type => "savestate", id => "skeleton", call => \&savestate);
}
@@ -221,6 +223,18 @@ sub formbuilder (@) {
debug("skeleton plugin running in formbuilder");
}
+sub renamepage (@) {
+ my %params=@_;
+
+ debug("skeleton plugin running in renamepage");
+}
+
+sub renamepages ($$$) {
+ my ($torename, $cgi, $session) = (shift, shift, shift);
+
+ debug("skeleton plugin running in rename");
+}
+
sub savestate () {
debug("skeleton plugin running in savestate");
}