]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Add jmtd's permalink plugin.
authorFrederik Vanrenterghem <frederik@vanrenterghem.biz>
Fri, 23 Dec 2022 04:58:34 +0000 (12:58 +0800)
committerFrederik Vanrenterghem <frederik@vanrenterghem.biz>
Fri, 23 Dec 2022 04:58:34 +0000 (12:58 +0800)
https://github.com/jmtd/ikiwiki/blob/permalink-plugin/IkiWiki/Plugin/permalink.pm

IkiWiki/Plugin/permalink.pm [new file with mode: 0644]

diff --git a/IkiWiki/Plugin/permalink.pm b/IkiWiki/Plugin/permalink.pm
new file mode 100644 (file)
index 0000000..f2ed7eb
--- /dev/null
@@ -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;