natemoo-re / astro-icon

Inline and sprite-based SVGs in Astro made easy!
https://astroicon.dev
Other
996 stars 57 forks source link

Feature: On Icon component you can choose more paths to host your local icons #91

Closed jorgeAgoiz closed 1 year ago

jorgeAgoiz commented 1 year ago

DESCRIPTION Added new prop called "path" to "Icon" component. This prop allows you to choose between three diferent directories to host your local icons when you use the "Icon" component.

Now the options are:

  1. default => /src/icons/
  2. assets => /src/assets/icons
  3. public => /public/icons

Related Issue:

38

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: 4550de061932c4d2f77ec8f710695d72c0157660

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-astroicon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 13, 2023 3:17pm
astroicon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 13, 2023 3:17pm
stramel commented 1 year ago

I have implemented a different approach in the v1 branch. https://github.com/natemoo-re/astro-icon/pull/97

Is there a benefit to hosting icons in multiple locations? Also, would you potentially have 2 unique icons named the same just in different locations?

I was thinking about adding support for multiple icon directories in the config like so:

iconDir: ['src/icons', 'public/icons']

If I did that, what would happen in a conflict of names?

stramel commented 1 year ago

I think we're going to move forward in the v1 with a single customizable directory and leave the v0 as is for now. Thanks for the contribution though.