LitoMore / simple-icons-cdn

Colorable Simple Icons CDN
https://cdn.simpleicons.org
MIT License
90 stars 4 forks source link

Serve icons given a version #4

Closed mondeja closed 9 months ago

mondeja commented 1 year ago

Seems that currently, if you use an icon link that is removed in a major version change, the link will break without notice. That is not desirable, so what about serving icons given a optional simple-icons version?

LitoMore commented 1 year ago

Yeah. I'm thinking about how to implement this feature.

We may need to integrate jsDelivr or unpkg into it.

LitoMore commented 1 year ago

We may also need UI or a list to let users know which icons are valid in a previous version. Otherwise, this feature is not very convenient to use.

By the way, this feature might take too much Bandwidth if most users specify the version for their icons. Like:

https://cdn.simpleicons.org/7.x.0/simpleicons
...
https://cdn.simpleicons.org/7.15.0/simpleicons
https://cdn.simpleicons.org/7.14.0/simpleicons
https://cdn.simpleicons.org/7.13.0/simpleicons
...
mondeja commented 1 year ago

We may also need UI or a list to let users know which icons are valid in a previous version.

I don't understand why, trying to get an icon or works or not.

By the way, this feature might take too much Bandwidth if most users specify the version for their icons.

I'm not too worried about it, we can always take some of the annual profits to increase the server quota, which by the way, it would be convenient if it is hosted on a subdomain of simpleicons.org like cdn.simpleicons.org.

LitoMore commented 1 year ago

We may also need UI or a list to let users know which icons are valid in a previous version.

Never mind. I just overthought this requirement.

It would be convenient if it is hosted on a subdomain of simpleicons.org like cdn.simpleicons.org.

I have added cdn.simpleicons.org to the project settings. The domain needs to be set.

CleanShot 2022-10-22 at 19 44 36@2x CleanShot 2022-10-22 at 19 48 24@2x
LitoMore commented 1 year ago

I can transfer this project to http://github.com/simple-icons for easy maintenance by the team.

mondeja commented 1 year ago

I can transfer this project to http://github.com/simple-icons for easy maintenance by the team.

Yes, that would be great. I've configured the CNAME record right now.

LitoMore commented 1 year ago

We need to send two GET requests to jsDelivr or unpkg to claim the icon and its color.

  1. GET https://cdn.jsdelivr.net/npm/simple-icons@7.17.0/_data/simple-icons.json to get the color.
  2. GET https://cdn.jsdelivr.net/npm/simple-icons@7.17.0/icons/simpleicons.svg to get the SVG content.

BTW, the main difference between users choosing simple-icons-cdn or jsDelivr is the coloring feature. Users can use jsDelivr instead of this if they just want an older version or stick to a specific version.

So I'm not sure it's a really needed requirement for users.

LitoMore commented 9 months ago

Closing in favor of the latest icons only, like shields.io.