Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
specify the same natsort algorithm in post_list (via natsort v4.0.0)
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 18, 2015
1 parent 82478ff commit f6cce11
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nikola/plugins/compile/rest/post_list.py
Expand Up @@ -27,12 +27,11 @@

import os
import uuid
import natsort

from docutils import nodes
from docutils.parsers.rst import Directive, directives

from natsort import natsorted

from nikola import utils
from nikola.plugin_categories import RestExtension

Expand Down Expand Up @@ -160,7 +159,7 @@ def run(self):
filtered_timeline.append(post)

if sort:
filtered_timeline = natsorted(filtered_timeline, key=lambda post: post.meta[lang][sort])
filtered_timeline = natsort.natsorted(filtered_timeline, key=lambda post: post.meta[lang][sort], alg=natsort.ns.F | natsort.ns.IC)

for post in filtered_timeline[start:stop:step]:
if slugs:
Expand Down

0 comments on commit f6cce11

Please sign in to comment.