From: intrigeri <intrigeri@boum.org>
Date: Thu, 27 Aug 2009 18:19:17 +0000 (+0200)
Subject: po: override the title template variable for coherent homepage titling
X-Git-Tag: 3.1415926~44
X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/f4583c1524ea1aab4ec1eb83a361355788b5b531

po: override the title template variable for coherent homepage titling

Signed-off-by: intrigeri <intrigeri@boum.org>
(cherry picked from commit 6c0f9c691c3df3a2ec30dec626c997623568a400)
---

diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 61f8db328..1b313a979 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -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.
@@ -957,6 +960,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;