Skip to content

Commit

Permalink
Merge pull request #1366 from CarstenGrohmann/fix-1365
Browse files Browse the repository at this point in the history
Fixed wrong filter order in post_list plugin (Issue #1365)
  • Loading branch information
Kwpolska committed Jul 19, 2014
2 parents 68ed0de + 05211a6 commit 32454b5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ Thomas Burette <https://github.com/tburette>
wimpr1m <https://github.com/wimpr1m>
yarko <https://github.com/yarko>
Alex Walters <https://github.com/tritium21>
Carsten Grohmann <https://github.com/CarstenGrohmann>
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Bugfixes
* Made ``nikola bootswatch_theme`` compatible with Jinja themes
* Fixed submenus in Jinja themes (Issue #1327)
* Quietly ignore empty lines in bundles files
* Fixed wrong filter order in post_list plugin (Issue #1365)

New in v7.0.1
=============
Expand Down
9 changes: 7 additions & 2 deletions nikola/plugins/compile/rest/post_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,23 +129,28 @@ def run(self):
else:
post_list_id = self.options.get('id', 'post_list_' + uuid.uuid4().hex)

filtered_timeline = []
posts = []
step = -1 if reverse is None else None
if show_all is None:
timeline = [p for p in self.site.timeline]
else:
timeline = [p for p in self.site.timeline if p.use_in_feeds]

for post in timeline[start:stop:step]:
for post in timeline:
if tags:
cont = True
tags_lower = [t.lower() for t in post.tags]
for tag in tags:
if tag in [t.lower() for t in post.tags]:
if tag in tags_lower:
cont = False

if cont:
continue

filtered_timeline.append(post)

for post in filtered_timeline[start:stop:step]:
if slugs:
cont = True
for slug in slugs:
Expand Down

0 comments on commit 32454b5

Please sign in to comment.