Fix the bug of archives
This commit is contained in:
parent
4277d28c9d
commit
3f8390be16
|
@ -23,6 +23,7 @@ class Archive(Index):
|
||||||
self.nb_pages = 0
|
self.nb_pages = 0
|
||||||
self.cur_page = 0
|
self.cur_page = 0
|
||||||
self.cur_article = 0
|
self.cur_article = 0
|
||||||
|
|
||||||
if len(articles) > self.articles_per_page:
|
if len(articles) > self.articles_per_page:
|
||||||
self.nb_pages = len(articles) / self.articles_per_page
|
self.nb_pages = len(articles) / self.articles_per_page
|
||||||
|
|
||||||
|
@ -91,6 +92,7 @@ class Archive(Index):
|
||||||
|
|
||||||
if i < nb_articles-1:
|
if i < nb_articles-1:
|
||||||
if articles[i].creation_date.year != articles[i+1].creation_date.year:
|
if articles[i].creation_date.year != articles[i+1].creation_date.year:
|
||||||
|
dom = parse(src + '/_archive.html')
|
||||||
self.createArchives(src, output, dom, hooks, my_articles)
|
self.createArchives(src, output, dom, hooks, my_articles)
|
||||||
self.cur_year = int(articles[i+1].creation_date.year)
|
self.cur_year = int(articles[i+1].creation_date.year)
|
||||||
#print 'New year ' + str(self.cur_year)
|
#print 'New year ' + str(self.cur_year)
|
||||||
|
@ -100,6 +102,7 @@ class Archive(Index):
|
||||||
else:
|
else:
|
||||||
my_articles.append(articles[i])
|
my_articles.append(articles[i])
|
||||||
else:
|
else:
|
||||||
|
# Last article
|
||||||
my_articles.append(article)
|
my_articles.append(article)
|
||||||
if nb_articles != 1 and articles[i].creation_date.year != articles[i-1].creation_date.year:
|
if nb_articles != 1 and articles[i].creation_date.year != articles[i-1].creation_date.year:
|
||||||
self.cur_year = int(articles[i].creation_date.year)
|
self.cur_year = int(articles[i].creation_date.year)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user