From: Joey Hess <joey@gnu.kitenet.net>
Date: Fri, 2 Oct 2009 16:37:53 +0000 (-0400)
Subject: mirrorlist: Display nothing if list is empty.
X-Git-Tag: 3.20091009~75
X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/0c6648f02c56a867d1078832921b185c3fce310d

mirrorlist: Display nothing if list is empty.
---

diff --git a/IkiWiki/Plugin/mirrorlist.pm b/IkiWiki/Plugin/mirrorlist.pm
index 737dcf767..d0a6107ef 100644
--- a/IkiWiki/Plugin/mirrorlist.pm
+++ b/IkiWiki/Plugin/mirrorlist.pm
@@ -29,7 +29,8 @@ sub pagetemplate (@) {
 	my %params=@_;
         my $template=$params{template};
 	
-	if ($template->query(name => "extrafooter")) {
+	if ($template->query(name => "extrafooter") &&
+	    keys %{$config{mirrorlist}} > 0) {
 		my $value=$template->param("extrafooter");
 		$value.=mirrorlist($params{page});
 		$template->param(extrafooter => $value);
diff --git a/debian/changelog b/debian/changelog
index b948aaf56..b6383bacb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ ikiwiki (3.14159266) UNRELEASED; urgency=low
   * toggle, relativedate: Support templates that add attributes
     to the body tag.
   * Support RPC::XML 0.69's incompatable object instantiation method.
+  * mirrorlist: Display nothing if list is empty.
 
  -- Joey Hess <joeyh@debian.org>  Sun, 27 Sep 2009 17:40:03 -0400