Suggestions for favicon configuration #1058
nix6839
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What version of
starlight
are you using?0.12.0
What is your idea?
Suggestions for favicon settings
Why is this feature necessary?
Currently, favicon configuration can be done in two ways: using the
favicon
setting andhead
setting. It works as follows:favicon
setting is not configured, it defaults to/favicon.svg
.favicon
is used, then only thefavicon
setting is applied.head
is set or both are used, thefavicon
setting's<link>
tag is inserted below thehead
setting's<link>
tag and applied together.Current Issues
favicon
setting.<link>
tag inserted by thefavicon
setting uses the non-conformingshortcut
attribute. This seems to be to differentiate betweenfavicon
andhead
settings.favicon
setting does not support this.head
setting requires more code than using thefavicon
setting.Proposed suggestions
I have three suggestions, with the first being highly recommended.
First Suggestion (Strongly Recommended)
Remove the
favicon
setting and provide a function for favicon configuration. Users would use this function to add favicons to thehead
setting, for example:This suggestion neatly resolves all the issues and simplifies the codebase:
favicon
andhead
settings, so shortcut is unnecessary. (Solves the second issue)However, this change could be a 'breaking change' that affects existing users.
Second Suggestion
favicon
setting's default to be deleted or to acceptnull
.data-*
attribute instead ofshortcut
to differentiate between thefavicon
andhead
settings.favicon
setting.This suggestion is more complex compared to the first suggestion and still does not solve the fourth and fifth issues.
Moreover, to me,
shortcut
anddata-*
feel like the same kind of noise.Third Suggestion
In addition to the second suggestion, the
favicon
setting accepts an array to allow for different favicon configurations.This addresses the fifth issue but leaves the other problems unresolved, and it increases complexity even more compared to the second suggestion.
I would like to hear your thoughts. If you agree, I will submit a PR for the suggestion.
Do you have examples of this feature in other projects?
No response
Participation
Beta Was this translation helpful? Give feedback.
All reactions