Skip to content
Permalink
Browse files

Fix #2011

  • Loading branch information
Juanjo Conti committed Sep 4, 2015
1 parent 2bd9ea5 commit 1d4ee2082878167548221dca38e09c17d22b4915
@@ -8,8 +8,11 @@
</header>
%if items:
<ul class="postlist">
% for text, link in items:
% for text, link, count in items:

This comment has been minimized.

Copy link
@humitos

humitos Sep 4, 2015

Member

if you have 0 post for some year/month it won't show the number between brackets: (0). Is that ok for you?

This comment has been minimized.

Copy link
@jjconti

jjconti Sep 4, 2015

Contributor

I think if there is 0 post for a month, the month is not even shown.

This comment has been minimized.

Copy link
@humitos

humitos Sep 4, 2015

Member

yeah, you are right... but, is that correct? I mean, to show maybe only two months of the year... or maybe nothing...

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Sep 4, 2015

Member

That’s what Nikola always does and always did in archives. We show only the months that exist, and don’t even generate pages for missing months.

This comment has been minimized.

Copy link
@jjconti

jjconti Sep 4, 2015

Contributor

@humitos years without posts are't listed either.

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska via email Sep 4, 2015

Member
<li><a href="${link}">${text}</a>
% if count:
(${count})
% endif
% endfor
</ul>
%else:
@@ -175,10 +175,10 @@ def gen_tasks(self):
if not kw["create_monthly_archive"] or kw["create_full_archives"]:
yield self._generate_posts_task(kw, year, lang, posts, title, deps_translatable)
else:
months = set([(m.split('/')[1], self.site.link("archive", m, lang)) for m in self.site.posts_per_month.keys() if m.startswith(str(year))])
months = set([(m.split('/')[1], self.site.link("archive", m, lang), len(self.site.posts_per_month[m])) for m in self.site.posts_per_month.keys() if m.startswith(str(year))])
months = sorted(list(months))
months.reverse()
items = [[nikola.utils.LocaleBorg().get_month_name(int(month), lang), link] for month, link in months]
items = [[nikola.utils.LocaleBorg().get_month_name(int(month), lang), link, count] for month, link, count in months]
yield self._prepare_task(kw, year, lang, None, items, "list.tmpl", title, deps_translatable)

if not kw["create_monthly_archive"] and not kw["create_full_archives"] and not kw["create_daily_archive"]:
@@ -219,7 +219,7 @@ def gen_tasks(self):
years.sort(reverse=True)
kw['years'] = years
for lang in kw["translations"]:
items = [(y, self.site.link("archive", y, lang)) for y in years]
items = [(y, self.site.link("archive", y, lang), len(self.site.posts_per_year[y])) for y in years]
yield self._prepare_task(kw, None, lang, None, items, "list.tmpl", kw["messages"][lang]["Archive"])

def archive_path(self, name, lang, is_feed=False):
@@ -204,7 +204,8 @@ def cat_path(i, displayed_i, num_pages, force_addition, extension=None):
should_render = False
else:
context["items"].append((post.title(lang),
post.permalink(lang)))
post.permalink(lang),
None))

if should_render:
task = self.site.generic_post_list_renderer(lang, post_list,

0 comments on commit 1d4ee20

Please sign in to comment.