X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/cfe101fff9f4469c4765e81ec5bb0a0b2ca2bec0..f0abaa9fc99463e403fa3b700bd005bcfaa75c6d:/IkiWiki/Plugin/po.pm?ds=inline diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 42a125808..96ba467c5 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -285,6 +285,9 @@ sub pagetemplate (@) { #{{{ if ($template->query(name => "istranslatable")) { $template->param(istranslatable => istranslatable($page)); } + if ($template->query(name => "HOMEPAGEURL")) { + $template->param(homepageurl => homepageurl($page)); + } if ($template->query(name => "otherlanguages")) { $template->param(otherlanguages => [otherlanguagesloop($page)]); map add_depends($page, $_), (values %{otherlanguages($page)}); @@ -359,6 +362,10 @@ sub change(@) { #{{{ resettranslationscache(); # Trigger a wiki refresh. require IkiWiki::Render; + # without preliminary saveindex/loadindex, refresh() + # complains about a lot of uninitialized variables + IkiWiki::saveindex(); + IkiWiki::loadindex(); IkiWiki::refresh(); IkiWiki::saveindex(); } @@ -399,6 +406,7 @@ sub mybeautify_urlpath ($) { #{{{ my $res=$origsubs{'beautify_urlpath'}->($url); if ($config{po_link_to} eq "negotiated") { $res =~ s!/\Qindex.$config{po_master_language}{code}.$config{htmlext}\E$!/!; + $res =~ s!/\Qindex.$config{htmlext}\E$!/!; } return $res; } #}}} @@ -705,6 +713,11 @@ sub otherlanguagesloop ($) { #{{{ } @ret; } #}}} +sub homepageurl (;$) { #{{{ + my $page=shift; + + return urlto('', $page); +} #}}} # ,---- # | PageSpec's