diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2007-10-24 23:07:39 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2007-10-24 23:07:39 -0400 |
commit | de5eb4996bbc8ab7d4263e70913de63e146d808d (patch) | |
tree | 2fa6a21ef2a7952609dd212f33a2e83cff085b33 /IkiWiki/Plugin/postsparkline.pm | |
parent | 239ce68ca08c4595d81b7222ef109d1b5942a5db (diff) | |
download | ikiwiki-de5eb4996bbc8ab7d4263e70913de63e146d808d.tar ikiwiki-de5eb4996bbc8ab7d4263e70913de63e146d808d.tar.gz |
* postsparkline: Avoid a confusing error message if no pages match
and instead show an empty graph.
Diffstat (limited to 'IkiWiki/Plugin/postsparkline.pm')
-rw-r--r-- | IkiWiki/Plugin/postsparkline.pm | 5 |
1 files changed, 5 insertions, 0 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}; |