summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2007-10-24 23:07:39 -0400
committerJoey Hess <joey@kodama.kitenet.net>2007-10-24 23:07:39 -0400
commitde5eb4996bbc8ab7d4263e70913de63e146d808d (patch)
tree2fa6a21ef2a7952609dd212f33a2e83cff085b33
parent239ce68ca08c4595d81b7222ef109d1b5942a5db (diff)
* postsparkline: Avoid a confusing error message if no pages match
and instead show an empty graph.
-rw-r--r--IkiWiki/Plugin/postsparkline.pm5
-rw-r--r--debian/changelog4
2 files changed, 8 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/postsparkline.pm b/IkiWiki/Plugin/postsparkline.pm
index ac7ad9d73..dc996ae32 100644
--- a/IkiWiki/Plugin/postsparkline.pm
+++ b/IkiWiki/Plugin/postsparkline.pm
@@ -56,6 +56,11 @@ sub preprocess (@) { #{{{
return "[[postsparkline error $@]]";
}
+ if (! @data) {
+ # generate an empty graph
+ push @data, 0 foreach 1..$params{max};
+ }
+
my $color=exists $params{color} ? "($params{color})" : "";
delete $params{pages};
diff --git a/debian/changelog b/debian/changelog
index 9ae87ca78..bc2ca4920 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,8 +11,10 @@ ikiwiki (2.11) UNRELEASED; urgency=low
* Removed manual ctime statting code, and just have the calendar plugin use
%pagectime.
* Ikiwiki has moved into a git repository.
+ * postsparkline: Avoid a confusing error message if no pages match
+ and instead show an empty graph.
- -- Joey Hess <joeyh@debian.org> Wed, 24 Oct 2007 22:19:31 -0400
+ -- Joey Hess <joeyh@debian.org> Wed, 24 Oct 2007 22:58:51 -0400
ikiwiki (2.10) unstable; urgency=low