saimn / sigal

yet another simple static gallery generator

Home Page:http://sigal.saimon.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document sort order options

shacker opened this issue · comments

The documentation for Album Information says we can sort the media in albums with:

Sort: -name

in index.md, but doesn't say what the possible values for Sort can be. I want to sort by date, oldest first. I tried date and -date but those did not have any effect. I then opened one of my images in Mac Preview and looked at the EXIF data in the Info panel. It showed keys like "Date Time Digitized" and "Date Time Original". I tried both of those, with and without quotes, and it had no effect. I then installed a proper EXIF viewer and it showed different key names, like "Original Date and Time" and "Digitized Date and Time." I tried all of those, with and without quotes, and rebuilt after each change, but nothing seems to work - images appear in a random order.

So, I'm confused about what's expected here, surprised that the documentation doesn't say anything about what I'd think would be the most common way people would want to sort, and perplexed that different tools (Preview and AnyExif) show different key names in the EXIF data.

I've searched the github Issues and it seems like others are able to get date sorting working - but how?

Ah! I just found that setting this:

medias_sort_attr = 'date'

in signal.conf.py does sort by date. So the documented technique of setting it in index.md has no effect, but setting it in the main project conf does. So either this is a bug or documentation update is needed. But I have a way forward. Thanks.

It seems Sort: only works for sub-albums currently... and I agree the documentation can be improved.

Oh - I did eventually figure this out, from a hint in another github issue:

Sort: DateTime

That does work from within index.md! Please consider documenting this.