Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort albums by 'Date' #121

Closed
jrstarke opened this issue Oct 22, 2014 · 5 comments
Closed

Sort albums by 'Date' #121

jrstarke opened this issue Oct 22, 2014 · 5 comments
Milestone

Comments

@jrstarke
Copy link
Contributor

I really like this project, and I think there are only a few small things to get it to a point I love it.

One of the things I'd like to be able to do is order my albums by reverse chronological (most recent at the top) so that when a user comes to my page, they see my most recent photos first.

I can think of two ways of achieving this, but I'd like to get your thoughts.

  1. Add a Date property to the index.md file in the album, and add a configuration flag to sort by date to the config. When sorting the albums, if the date flag is set, order by this date, or alphabetic if none is available.
  2. For each album, get the most recent exif from the medias, and then sort the albums based on their most recent media.

For complexity reasons, I'm more inclined to 1, but I figured it might be good to get some feedback before attempting to build something.

@jrstarke
Copy link
Contributor Author

I noticed looking back through the old pull requests that it sounds like this isn't a new idea (see #2), is this something that was already completed?

@saimn
Copy link
Owner

saimn commented Oct 23, 2014

Hi @jrstarke ,
The feature that is already implemented is the sort by date of images, inside an album, but not the sort of albums. The 2nd solution would be the best, and it should not be very hard to do. It could be done in a similar way to what is done for images (https://github.com/saimn/sigal/blob/master/sigal/gallery.py#L296).

@j0nes2k
Copy link
Contributor

j0nes2k commented Oct 25, 2014

@jrstarke , +1 for the idea! While for general usage I prefer your second solution, I really see a use case for the first idea, too. Here is my use case at the moment: I use folders sorted by month (like: 2014-10, 2014-09 and so on) and generate a complete gallery from these albums. Then I (manually) create an index.md file inside these folders to translate the album title to a more readable format (like: October 2014, September 2014...). When using a Date property, this could get a standard way to offer localized folder names.

@ghost
Copy link

ghost commented Nov 14, 2014

Hello guys. First, thank you about all effort in this project. It's amazing. Now, about this issue, I manage organize albums by date with a simple command in crontab:
cd /xx && exiftool '-Directory<DateTimeOriginal' -d %Y/%m/%d *

trapperhoney added a commit to trapperhoney/sigal that referenced this issue Jan 18, 2016
This adds an 'albums_sort_attr' configuration modeled off of the
'medias_sort_attr'.  It defaults to the existing behavior of sorting
sub-albums by directory name.  It allows sort by any metadata attribute
stored in the album metadata file.

The existing album sort test wasn't really verifying album sorting
behavior, so I just re-wrote the whole thing to include tests for the
old behavior and new.

This should resolve issue saimn#121
@saimn
Copy link
Owner

saimn commented Feb 15, 2016

Fixed with #192

@saimn saimn closed this as completed Feb 15, 2016
@saimn saimn added this to the 1.1.0 milestone Feb 15, 2016
kontza pushed a commit to kontza/sigal that referenced this issue Aug 28, 2020
This adds an 'albums_sort_attr' configuration modeled off of the
'medias_sort_attr'.  It defaults to the existing behavior of sorting
sub-albums by directory name.  It allows sort by any metadata attribute
stored in the album metadata file.

The existing album sort test wasn't really verifying album sorting
behavior, so I just re-wrote the whole thing to include tests for the
old behavior and new.

This should resolve issue saimn#121
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants