iconify / icon-sets

150+ open source icon sets. Icons are validated, cleaned up, optimised, ready to render as SVG. Updated automatically 3 times a week.
https://icon-sets.iconify.design/
591 stars 56 forks source link

Provide meta data in icon JSON files #47

Open CreativeDive opened 2 years ago

CreativeDive commented 2 years ago

Hey, first of all thank you for your great work.

I'm wondering if it's possible to include meta data like "search terms" in the json files for each icon if the library provides it?

cyberalien commented 2 years ago

Sure, you can add custom stuff to files.

I think search terms do make sense. It could be very useful.

CreativeDive commented 2 years ago

@cyberalien Yes that would be very useful. Everyone could benefit from it if this were already included in iconify.

But I also understand if you want to keep the json files light.

cyberalien commented 2 years ago

Yes, I do want to keep files light, but this specific use case sound really good. I'm immediately considering how this could be used.

If I'm not mistaken, several icon sets already do have metadata for that, so it could be filled immediately. Problem is with search engine, which will not use it for a while until I'll finally refactor it, but at least there will be possibility for future.

As a bonus, I'm planning to add function for publishing icon sets from Figma and this would allow designers to set alternative keywords for icons.

Downside is, possibility for search results spam. Same icons appearing for different keywords might lead to bad search results, so this needs to be considered. One possible solution is to show search terms matches after direct keyword matches.

So overall I think this is a really good suggestion. It could be something like this:

interface IconifyMetaData {
   // ... other stuff

   // Keywords. Key is icon name, value is array of search terms
   keywords: Record<string, string[]>;
}
CreativeDive commented 2 years ago

... but at least there will be possibility for future.

Thank you. This sounds very good. Anyone who uses iconify and supplies thousands of icons with it will certainly be happy about a solution for searching for the icons. If the search terms are included, then that would be very helpful.

Thanks for your thoughts.