Skip to content

Conversation

IgnoredSoul
Copy link

Updated the Simple Icons and MDI URLs to use unpkg in cases where jsDelivr is blocked by EasyList. There are likely more efficient ways to handle this, but I have very little experience with Go.

I wasn’t able to find an unpkg version for Homarr or Selfhst, may be other alternatives for them. ¯_(ツ)_/¯

Modified simple-icons & mdi to use unpgk if jsdelivr is filtered by EasyList.
*/
var activeCDN string

func detectCDN() string {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should return an error

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't return an error in my testing, but let me know if it did on your end.

Copy link

@himazawa himazawa Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the function detectCDN() should return an error instead of "None" in case you don't find anything because that's how it should behave according to best practices.
You can read more here:
https://go.dev/doc/tutorial/handle-errors

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see what you mean.

I didn’t bother throwing an error since I didn't see it as important, it returns "None" so we don't need to check again if neither CDN is valid.

That said, returning or logging something could definitely help make it clearer to the end-user why icons aren’t showing up. If you or anyone wants to build on that, go for it. This was really just meant as a quick fix.

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.

2 participants