1 I'm writing a plugin to wikify c/c++ code.
3 By default ikiwiki generates xxx.html for a file called xxx.c.
5 The problem is that I occasionally have xxx.c and xxx.h in the same directory and there's a filename collision.
7 My solution is to allow plugins to provide a hook that sets the pagename. --[[/users/bstpierre]]
9 > You might also find the solution to [[bugs/multiple_pages_with_same_name]] helps you. That patch is already applied. -- [[Will]]
11 --- /usr/share/perl5/IkiWiki.pm.ORIG 2008-10-03 14:12:50.000000000 -0400
12 +++ /usr/share/perl5/IkiWiki.pm 2008-10-07 11:57:26.000000000 -0400
18 my $type=pagetype($file);
21 + exists $hooks{pagename} &&
22 + exists $hooks{pagename}{$type}) {
24 + return $hooks{pagename}{$type}{call}($file);
29 $page=~s/\Q.$type\E*$// if defined $type;