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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of
starlightare 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
faviconsetting andheadsetting. It works as follows:faviconsetting is not configured, it defaults to/favicon.svg.faviconis used, then only thefaviconsetting is applied.headis set or both are used, thefaviconsetting's<link>tag is inserted below theheadsetting's<link>tag and applied together.Current Issues
faviconsetting.<link>tag inserted by thefaviconsetting uses the non-conformingshortcutattribute. This seems to be to differentiate betweenfaviconandheadsettings.faviconsetting does not support this.headsetting requires more code than using thefaviconsetting.Proposed suggestions
I have three suggestions, with the first being highly recommended.
First Suggestion (Strongly Recommended)
Remove the
faviconsetting and provide a function for favicon configuration. Users would use this function to add favicons to theheadsetting, for example:This suggestion neatly resolves all the issues and simplifies the codebase:
faviconandheadsettings, so shortcut is unnecessary. (Solves the second issue)However, this change could be a 'breaking change' that affects existing users.
Second Suggestion
faviconsetting's default to be deleted or to acceptnull.data-*attribute instead ofshortcutto differentiate between thefaviconandheadsettings.faviconsetting.This suggestion is more complex compared to the first suggestion and still does not solve the fourth and fifth issues.
Moreover, to me,
shortcutanddata-*feel like the same kind of noise.Third Suggestion
In addition to the second suggestion, the
faviconsetting 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