1 Enables _Read more_ links for use in blog posts. Adds a config option for customising the anchor text. (The [[/patchqueue/htmllink-anchors]] patch is a dependency).
3 Index: IkiWiki/Plugin/morelink.pm
4 ===================================================================
5 --- IkiWiki/Plugin/morelink.pm (revision 0)
6 +++ IkiWiki/Plugin/morelink.pm (revision 0)
9 +package IkiWiki::Plugin::morelink;
15 +my $linktext = 'Read more';
18 + hook(type => "checkconfig", id => "more", call => \&checkconfig);
19 + hook(type => "preprocess", id => "more", call => \&preprocess);
22 +sub checkconfig () { #{{{
23 + $linktext = $config{morelink_text} || $linktext;
26 +sub preprocess (@) { #{{{
29 + if ($args{page} ne $args{destpage}) {
30 + return "\n".htmllink($args{page}, $args{destpage}, $args{page}.'#more', 0, 0, $linktext);
33 + return "<a name='more'></a>".$args{text};