diff options
Diffstat (limited to 'doc/plugins/write.mdwn')
-rw-r--r-- | doc/plugins/write.mdwn | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 405876d58..eb50ca4ef 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -360,14 +360,25 @@ This hook is called whenever ikiwiki normally saves its state, just before the state is saved. The function can save other state, modify values before they're saved, etc. -### renamepage +### renamelink - hook(type => "renamepage", id => "foo", call => \&renamepage); + hook(type => "renamelink", id => "foo", call => \&renamelink); This hook is called by the [[plugins/rename]] plugin when it renames -something. The hook is passed named parameters: `page`, `oldpage`, -`newpage`, and `content`, and should try to modify the content to reflect -the name change. For example, by converting links to point to the new page. +something, once per page linking to the renamed page's old location. +The hook is passed named parameters: `page`, `oldpage`, `newpage`, and +`content`, and should try to modify the content of `page` to reflect +the name change. For example, by converting links to point to the +new page. + +### rename + + hook(type => "rename", id => "foo", call => \&renamepages); + +When a page or set of pages is renamed, the referenced function is +called, and passed a reference to an array of hashes with keys: +`src`, `srcfile`, `dest`, `destfile`, `required`. It can modify +the array. ### getsetup |