]> sipb.mit.edu Git - ikiwiki.git/commitdiff
po: override the title template variable for coherent homepage titling
authorintrigeri <intrigeri@boum.org>
Thu, 27 Aug 2009 18:19:17 +0000 (20:19 +0200)
committerintrigeri <intrigeri@boum.org>
Thu, 27 Aug 2009 18:19:17 +0000 (20:19 +0200)
Signed-off-by: intrigeri <intrigeri@boum.org>
IkiWiki/Plugin/po.pm

index 3039334c411d21f9fe097ec7b753212206d4a755..2b2839f24f1d3a5bfbf03954e04df2fc3cf18b58 100644 (file)
@@ -302,6 +302,9 @@ sub pagetemplate (@) {
            && $masterpage eq "index") {
                $template->param('parentlinks' => []);
        }
+       if (ishomepage($page) && $template->query(name => "title")) {
+               $template->param(title => $config{wikiname});
+       }
 } # }}}
 
 # Add the renamed page translations to the list of to-be-renamed pages.
@@ -960,6 +963,14 @@ sub homepageurl (;$) {
        return urlto('', $page);
 }
 
+sub ishomepage ($) {
+       my $page = shift;
+
+       return 1 if $page eq 'index';
+       map { return 1 if $page eq 'index.'.$_ } keys %{$config{po_slave_languages}};
+       return undef;
+}
+
 sub deletetranslations ($) {
        my $deletedmasterfile=shift;