New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: autogen section icons
#72
Conversation
app/server/plugins/content.ts
Outdated
|
||
// Set the icon for the file if it is not already set | ||
if (commonIcons?.[file._path] && !file.icon) { | ||
file.icon = commonIcons[file._path] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use a fuzzy search on both path and title?
Also maybe we could somehow get list of all available icons from iconify? Thinking this because I found it so repetitive for example for finding library/company logos and adding them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could maybe leverage their APIs? (just an idea imagined might be one)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds like a good idea, but wouldn't this decrease performance? api hit on every file? Unless there was a super fast cache api that doesn't take long at all. Then trying to figure which the "preferred" icon set to use is another challenge, unless we knew a head of time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could potentially host our own api on a new domain (take advantage of cache)-> https://iconify.design/docs/api/hosting.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also saw antfu icones data filtering -> https://github.com/antfu/icones/blob/main/src/data/index.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pi0 I created a POC that gathered the data we need with a script that generates a file and uses fuse to search. There is still some missing pieces that I would like to figure out.
- Better aliases (Like custom for unjs)
- How to predicate which set to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice POC!! Refactored resolve fn so we can easily iterate and integrate with full resolver.
π Linked issue
#68
β Type of change
π Description
Resolves: #68
π Checklist