From e897275dd1e8554033a2159f6401d17909f9c8c2 Mon Sep 17 00:00:00 2001 From: Frederik Vanrenterghem Date: Fri, 23 Dec 2022 12:58:34 +0800 Subject: [PATCH 1/1] Add jmtd's permalink plugin. https://github.com/jmtd/ikiwiki/blob/permalink-plugin/IkiWiki/Plugin/permalink.pm --- IkiWiki/Plugin/permalink.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 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; -- 2.39.5