1 The `IkiWiki::pagetitle` function does not respect title changes via `meta.title`. It really should, so that links rendered with `htmllink` get the proper title in the link text.
7 It is possible to set a Page-Title in the meta-plugin, but that one isn't
8 reused in parentlinks. This [[patch]] may fix it.
11 <li> I give pagetitle the full path to a page.
12 <li> I redefine the 'pagetitle'-sub to deal with it.
13 <li> to maintain compatibility for IkiWikis without the meta-plugin, i added a 'basename' to the Original-pagetitle.
17 diff -c /usr/share/perl5/IkiWiki/Render.pm.distrib /usr/share/perl5/IkiWiki/Render.pm
18 *** /usr/share/perl5/IkiWiki/Render.pm.distrib Wed Aug 6 07:34:55 2008
19 --- /usr/share/perl5/IkiWiki/Render.pm Tue Aug 26 23:29:32 2008
23 title => $page eq 'index'
25 ! : pagetitle(basename($page)),
26 wikiname => $config{wikiname},
28 backlinks => $backlinks,
31 title => $page eq 'index'
34 wikiname => $config{wikiname},
36 backlinks => $backlinks,
38 diff -c /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm.distrib /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm
39 *** /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm.distrib Wed Aug 6 07:34:55 2008
40 --- /usr/share/perl5/IkiWiki/Plugin/parentlinks.pm Tue Aug 26 23:19:43 2008
43 "height_$height" => 1,
46 ! $title=IkiWiki::pagetitle($dir);
51 "height_$height" => 1,
54 ! $title=IkiWiki::pagetitle($path);
59 diff -c /usr/share/perl5/IkiWiki.pm.distrib /usr/share/perl5/IkiWiki.pm
60 *** /usr/share/perl5/IkiWiki.pm.distrib Wed Aug 6 07:48:34 2008
61 --- /usr/share/perl5/IkiWiki.pm Tue Aug 26 23:47:30 2008
68 + $page=basename($page);
71 $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : chr($2)/eg;
74 diff -c /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib /usr/share/perl5/IkiWiki/Plugin/meta.pm
75 *** /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib Wed Aug 6 07:34:55 2008
76 --- /usr/share/perl5/IkiWiki/Plugin/meta.pm Tue Aug 26 23:30:58 2008
80 package IkiWiki::Plugin::meta;
83 + no warnings 'redefine';
93 + sub IkiWiki::pagetitle ($;$) {
95 + my $unescaped=shift;
97 + if ($page =~ m#/#) {
99 + $page =~ s#/index$##;
100 + if ($pagestate{"$page/index"}{meta}{title}) {
101 + $page = $pagestate{"$page/index"}{meta}{title};
103 + $page = IkiWiki::basename($page);
108 + $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : chr($2)/eg;
111 + $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : "&#$2;"/eg;
117 package IkiWiki::PageSpec;
119 sub match_title ($$;@) {
125 > A few quick notes about it:
127 > - Using <code>inline</code> would avoid the redefinition + code duplication.
128 > - A few plugins would need to be upgraded.
129 > - It may be necessary to adapt the testsuite in `t/pagetitle.t`, as well.
133 >> It was actually more complicated than expected. A working prototype is
134 >> now in my `meta` branch, see my userpage for the up-to-date url.
135 >> Thus tagging [[patch]]. --[[intrigeri]]
137 >>> Joey, please consider merging my `meta` branch. --[[intrigeri]]