From: Frederik Vanrenterghem Date: Fri, 23 Dec 2022 04:58:34 +0000 (+0800) Subject: Add jmtd's permalink plugin. X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/e897275dd1e8554033a2159f6401d17909f9c8c2 Add jmtd's permalink plugin. https://github.com/jmtd/ikiwiki/blob/permalink-plugin/IkiWiki/Plugin/permalink.pm --- diff --git a/IkiWiki/Plugin/permalink.pm b/IkiWiki/Plugin/permalink.pm new file mode 100644 index 000000000..f2ed7ebcd --- /dev/null +++ b/IkiWiki/Plugin/permalink.pm @@ -0,0 +1,16 @@ +package IkiWiki::Plugin::permalink; + +use warnings; +use strict; +use IkiWiki '3.00'; + +sub import { + hook(type => "pagetemplate", id=> "permalink", call => \&pagetemplate); +} + +sub pagetemplate () { + my %params=@_; + $params{template}->param(permalink => urlto($params{page},"",1)); +} + +1;