From 8a24ebd602e2664db873b75d5230dad31d23feca Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Wed, 8 Feb 2012 13:22:31 +0100 Subject: [PATCH] Do not generate paged indexes if using 'grouped_index'. --- bin/gruta-snapshot | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/gruta-snapshot b/bin/gruta-snapshot index df4dc1d..22098cf 100755 --- a/bin/gruta-snapshot +++ b/bin/gruta-snapshot @@ -95,12 +95,16 @@ my @all = $g->source->stories_by_date(\@topics); my $max = scalar(@all) - $index_num; my $offset = $index_num; -print "$max stories\n"; +# if @all is empty, it can be because 'cfg_index_topics' contain +# numbers and uses 'grouped_index', so this may not be an error +if (scalar(@all)) { + print "$max stories\n"; -while ($max > 0) { - out($g, 'INDEX', "${offset}.html", { num => $index_num, offset => $offset }); - $offset += $index_num; - $max -= $index_num; + while ($max > 0) { + out($g, 'INDEX', "${offset}.html", { num => $index_num, offset => $offset }); + $offset += $index_num; + $max -= $index_num; + } } out($g, 'CSS', 'style.css'); -- 2.11.4.GIT