]> scripts.mit.edu Git - www/ikiwiki.git/blobdiff - IkiWiki/Plugin/po.pm
po: added HOMEPAGEURL template variable, documented when to use it
[www/ikiwiki.git] / IkiWiki / Plugin / po.pm
index 42a125808addaa570f4157d2dfa2c089a7ecbfff..739564c6bb01b47a866bb180128c1d04ef8b3d21 100644 (file)
@@ -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)});
@@ -705,6 +708,11 @@ sub otherlanguagesloop ($) { #{{{
                } @ret;
 } #}}}
 
+sub homepageurl (;$) { #{{{
+       my $page=shift;
+
+       return urlto('', $page);
+} #}}}
 
 # ,----
 # | PageSpec's