-
Notifications
You must be signed in to change notification settings - Fork 140
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
add default favicon to templates #1116
Conversation
Safari doesn’t support SVG favicons; you have to use the nonstandard mask-icon. 😞 |
asset supports both dark and light modes (by @pettiross); minified down to 493 bytes |
Can we not use our official favicon? I like it better. I don’t like that hairline white halo in dark mode. |
OK to change the icon. I thought of a different way to implement this that would make it easier to opt in and out: when we normalize the config, and if head is undefined, we could check for the existence of |
Hmm, checking for favicon.png feels a little magical to me — it’s not hard to set the head option, is it? Especially if we now show you how to do it with the default template? |
I was thinking it could be useful for a beginner who does not open the config file and removes favicon.png from docs/. But the current code is working in a good way in that situation: the generated page points to the non-existing /favicon.png, a 404 is shown in the network inspector, all the information is there and nothing is badly broken. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you’ve replaced the image with the gray version let me know and I’ll take another look.
I am also tempted to call it observable.png
rather than favicon.png
, and to set sizes="32x32"
, so as to encourage authors to use a differently-named file if they want to replace it, and thereby force discovery of the head option if you want to change the favicon. But not a requirement.
Yes I'm only hesitant to use a 15kB 512x512 image, when we could minify a 32x32 image for 394 bytes. (It's not on the hot path, so not a big deal.) |
You can use |
Done. I also tested a build, just in case :) |
Co-authored-by: Mike Bostock <[email protected]>
TODO:
see if we use autodetection of the favicon.png asset(in observablehq.config.ts or in normalizeconfig)?closes #674