mfg92 / hugo-shortcode-gallery

A theme component with a gallery shortcode for the static site generator hugo.
MIT License
359 stars 66 forks source link

sortOrder not working #72

Closed saeedesmaili closed 8 months ago

saeedesmaili commented 8 months ago

I'm using the shortcut as stated in the readme:

{{< gallery match="images/*" sortOrder="desc" rowHeight="150" margins="5" thumbnailResizeOptions="600x600 q90 Lanczos" showExif=true previewType="blur" embedPreview=true loadJQuery=true >}}

But changing the value of sortOrder to asc or randomize doesn't seem to do anything, and with all three values the sorting of the images is from first to last. Am I doing something wrong here?

mfg92 commented 8 months ago

I have tested sortOrder="desc" and sortOrder="desc" with my web page and they work as expected. Please note that randomize is not an option of sortOrder, but instead is a independent parameter, it is used like this: {< gallery match="images/*" randomize=true >}}

Maybe it has something to do with the names of your images. Can you provide a small sample project to demonstrate your problem?

saeedesmaili commented 8 months ago

I tried the desc order on another laptop and it works now when building locally (probably there was an issue on my side).

And thanks for making it clear how the randomize should be used, I never realized it's a separate parameter.