tomanistor/osprey

Sort gallery pages

jrobalino opened this issue · 1 comments

Is there a way to sort gallery pages in a custom order?

I see that the gallery.html file bases its order on .Site.RegularPages, but I was wondering if there was a field (or workaround) that could determine the list order of this array, aside from creating content in a specific chronological order, which may not be ideal if I want to feature a mixture of older and newer posts.

Thanks!

Hey @jrobalino, you should be able to add a weight to each gallery file's front matter and with that, you can override the reverse chronological order and manipulate it as you see fit.

e.g. weight = 2 will render a gallery image 2nd to last unless there is no weight = 1, in which case it will render last.