Skip to content
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

Merged
merged 7 commits into from Mar 4, 2024
Merged

feat: autogen section icons #72

merged 7 commits into from Mar 4, 2024

Conversation

cpreston321
Copy link
Member

πŸ”— Linked issue

#68

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Resolves: #68

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

cloudflare-pages bot commented Feb 26, 2024

Deploying with Β Cloudflare Pages Β Cloudflare Pages

Latest commit: 2a655a0
Status:⚑️  Build in progress...

View logs

app/server/plugins/content.ts Outdated Show resolved Hide resolved

// Set the icon for the file if it is not already set
if (commonIcons?.[file._path] && !file.icon) {
file.icon = commonIcons[file._path]
Copy link
Member

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.

Copy link
Member

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)

Copy link
Member Author

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.

Copy link
Member Author

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

Copy link
Member Author

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

Copy link
Member Author

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?

https://github.com/cpreston321/poc-iconify-search

Copy link
Member

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.

@pi0 pi0 merged commit c770991 into main Mar 4, 2024
2 of 3 checks passed
@pi0 pi0 deleted the feat/sectionIcons branch March 4, 2024 16:49
@pi0 pi0 mentioned this pull request Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autogen section icons
2 participants