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

Outdated Simpleicons library version #230

Open
Ashpex opened this issue Oct 3, 2024 · 1 comment
Open

Outdated Simpleicons library version #230

Ashpex opened this issue Oct 3, 2024 · 1 comment
Milestone

Comments

@Ashpex
Copy link

Ashpex commented Oct 3, 2024

Yesterday, I was looking for the Audiobookshelf icon to add to my services monitor and found that it wasn't available due to an outdated version of the SimpleIcons library. We are currently using version 11.14.0 from cdnjs, while the latest version is already at 13.12

func toSimpleIconIfPrefixed(icon string) (string, bool) {
	if !strings.HasPrefix(icon, "si:") {
		return icon, false
	}

	icon = strings.TrimPrefix(icon, "si:")
	icon = "https://cdnjs.cloudflare.com/ajax/libs/simple-icons/11.14.0/" + icon + ".svg"

	return icon, true
}

Hard-coding the library version into the codebase like this isn't ideal. A better approach would be to retrieve the SimpleIcons source URL from a configuration field. This way, you wouldn't need to update the source code whenever SimpleIcons updates.

@svilenmarkov
Copy link
Member

Thanks for bringing this up.

To prevent this from becoming an issue again for the foreseeable future I'll just change this to always use the latest version, however it appears that cdnjs doesn't support doing this so I'll switch to jsdelivr. I wouldn't do this if it were a JS dependency but since it's only used for images I believe it should be fairly safe.

@svilenmarkov svilenmarkov added this to the v0.7.0 milestone Oct 10, 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

No branches or pull requests

2 participants