diff options
author | intrigeri <intrigeri@boum.org> | 2009-01-15 21:49:32 +0100 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2009-01-15 21:49:32 +0100 |
commit | 5c59ad63df5fb618a9088fb74e496eccdf5b759d (patch) | |
tree | e698eacd21c34be91bdd782dcd9b66918a3293d0 /IkiWiki/Plugin | |
parent | 7ca396d6eebdc055b946cae70cb3c1ac9d3252fa (diff) |
po: fix broken links from slave pages
... by overriding cgiurl.
Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/po.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 157575483..a050d2b71 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -56,6 +56,8 @@ sub import { inject(name => "IkiWiki::urlto", call => \&myurlto); $origsubs{'nicepagetitle'}=\&IkiWiki::nicepagetitle; inject(name => "IkiWiki::nicepagetitle", call => \&mynicepagetitle); + $origsubs{'cgiurl'}=\&IkiWiki::cgiurl; + inject(name => "IkiWiki::cgiurl", call => \&mycgiurl); } @@ -599,6 +601,16 @@ sub mynicepagetitle ($;$) { return $res.' ('.percenttranslated($page).' %)'; } +sub mycgiurl (@) { + my %params=@_; + + # slave pages have no subpages + if (istranslation($params{'from'})) { + $params{'from'} = masterpage($params{'from'}); + } + return $origsubs{'cgiurl'}->(%params); +} + # ,---- # | Blackboxes for private data # `---- |