diff --git a/src/sigal/gallery.py b/src/sigal/gallery.py index 539e217..f9eefa0 100644 --- a/src/sigal/gallery.py +++ b/src/sigal/gallery.py @@ -515,7 +515,7 @@ class Album: continue return "" - key = natsort_keygen(key=sort_key, alg=ns.LOCALE) + key = natsort_keygen(key=sort_key, alg=ns.SIGNED|ns.LOCALE) self.subdirs.sort(key=key, reverse=reverse) signals.albums_sorted.send(self) diff --git a/tests/sample/pictures/dir1/test2/index.md b/tests/sample/pictures/dir1/test2/index.md index 576d6c7..7920a50 100644 --- a/tests/sample/pictures/dir1/test2/index.md +++ b/tests/sample/pictures/dir1/test2/index.md @@ -1 +1,2 @@ -Order: 01 +Order: -10 +PartialOrder: 01 diff --git a/tests/test_gallery.py b/tests/test_gallery.py index 211c161..e33e017 100644 --- a/tests/test_gallery.py +++ b/tests/test_gallery.py @@ -234,8 +234,7 @@ def test_albums_sort(settings): a.sort_subdirs("title") assert [im.title for im in a.albums] == list(reversed(titles)) - orders = ["01", "02", "03"] - orders.sort() + orders = ["-10", "02", "03"] settings["albums_sort_reverse"] = False a = Album("dir1", settings, album["subdirs"], album["medias"], gal) a.sort_subdirs("meta.order")