mfg92/hugo-shortcode-gallery

Clarification on filterOptions

Closed this issue · 2 comments

Hi! I'd like to implement the filtering in my gallery. I see that I can filter by " EXIF tags, image description, start rating or color labels". What exif tag should I create/use if I want to filter similarly to your example site ("Favourites, birds, insects, etc.).

I really do love this gallery shortcode and thank you for all your hardwork!

mfg92 commented

The filterOptions of my website are these:

[
   {label: 'Favorites', color_label: 'red'},
   {label: 'All', tags: '.*'},
   {label: 'Birds', tags: 'bird'},
   {label: 'Macro', tags: 'macro'},
   {label: 'Insects', tags: 'insect'},
   {label: 'Abstract', tags: 'abstract'},
   {label: 'Landscape', tags: 'landscape'},
   {label: 'Leafs', tags: 'plant\\|leaf|leafs collection'}
]

The meta file of an image may look like this:

{
   "ColorLabels":"r",
   "Rating":3,
   "Tags": ["published|matze.rocks","juvenile","animal|bird|oystercatcher|eurasian oystercatcher","published|matze.rocks|article|heligoland2022"]
}

A metadata sidecar file (like the one above) is only optional, as the metadata of the EXIF embedded in the image can be used for filtering too.

I'm not sure if this answers your question.

Ah! I understand now. Thank you for your help :) I was able to set up the filters