Psycojoker / prosopopee

a static website generator to make beautiful customizable pictures galleries that tell a story
http://prosopopee.readthedocs.org
GNU General Public License v3.0
331 stars 56 forks source link

Add next and previous gallery in gallery #55

Open beudbeud opened 8 years ago

beudbeud commented 8 years ago

in utils.py

def previous_and_next(some_iterable):
    prevs, items, nexts = tee(some_iterable, 3)
    prevs = chain([None], prevs)
    nexts = chain(islice(nexts, 1, None), [None])
    return izip(prevs, items, nexts)

for work i use this fonction but they not work well because i use it in this loop

for gallery in dirs:

but dirs is not sort by date