better describe sort option in md file

This commit is contained in:
Simon Conseil
2024-04-02 21:39:07 +02:00
parent 114f4e2d42
commit 3296271e9c
2 changed files with 3 additions and 2 deletions

View File

@@ -22,8 +22,8 @@ gallery:
represent the gallery. represent the gallery.
- *Author*: the author of the gallery, if present it is used instead of the - *Author*: the author of the gallery, if present it is used instead of the
author setting. author setting.
- *Sort*: the sort order for this album. If prefixed with a '-' it will be in - *Sort*: the sort order for the sub-albums of this album. If prefixed with
reversed order. a '-' it will be in reversed order. Not supported to sort medias.
Any additional meta-data is available in the templates. For instance:: Any additional meta-data is available in the templates. For instance::

View File

@@ -486,6 +486,7 @@ class Album:
reverse = self.settings["albums_sort_reverse"] reverse = self.settings["albums_sort_reverse"]
if "sort" in self.meta: if "sort" in self.meta:
# override default sort order from settings
albums_sort_attr = self.meta["sort"][0] albums_sort_attr = self.meta["sort"][0]
if albums_sort_attr[0] == "-": if albums_sort_attr[0] == "-":
albums_sort_attr = albums_sort_attr[1:] albums_sort_attr = albums_sort_attr[1:]