Skip to content
Permalink
Browse files

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 f6cce1138f2e64c1eea5fd1a5a5142689cb8ae4a
Showing with 2 additions and 3 deletions.
  1. +2 −3 nikola/plugins/compile/rest/post_list.py
@@ -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

@@ -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:

0 comments on commit f6cce11

Please sign in to comment.