This hook can be used to modify the internal urls generated by ikiwiki.
Signed-off-by: intrigeri <intrigeri@boum.org>
$url =~ s!/index.$config{htmlext}$!/!;
}
+ run_hooks(urlpath => sub {
+ $url=shift->(url => $url);
+ });
+
# Ensure url is not an empty link, and
# if it's relative, make that explicit to avoid colon confusion.
if ($url !~ /^\//) {
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 () { #{{{
debug("skeleton plugin running in targetpage");
} #}}}
+sub urlpath () { #{{{
+ debug("skeleton plugin running in urlpath");
+} #}}}
+
1
It should return the target filename.
+### urlpath
+
+ hook(type => "urlpath", id => "foo", call => \&urlpath);
+
+This hook can be used to modify the internal urls generated by
+ikiwiki; it is run just after ikiwiki has removed the trailing
+`index.html`, in case `usedirs` is enabled.
+
+It should return the modified url.
+
## Plugin interface
To import the ikiwiki plugin interface: