Open jasongitmail opened 1 year ago
This may be obvious to others, but was not obvious to me.
When adding these files, use the following locations:
<html lang="en">
<head>
...
<link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png"><!-- 180×180 -->
<link rel="manifest" href="/manifest.webmanifest">
...
Do not try to put the icon assets in other locations (eg in a subdirectory of /static as i tried). These will not work as expected
Describe the problem
Knowing what favicon (ICO, PNG, SVG), apple-touch-icons, manifest, which resolutions, etc is a pain for modern developers and hard to keep up with.
Describe the proposed solution
If SvelteKit included boilerplate assets (using SvelteKit logo) in the Skeleton project, it would indicate suggested branding assets and smooth this aspect for future devs.
I found a solution for myslelf in this article, referenced by Chris Coyier. https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs Updated, based on the fix mentioned in this comment to prevent Chrome downloading both
ico
andsvg
favicons.The article has really good research and reasoning.
The extra benefit is these can be put into suggested locations--e.g.
static/favicon.ico
and linked from within app.html, and the rest in a main+svelte.layout
imported via Vite to receive hashed file names and far futures cache headers, likely imported from somewhere like$lib/assets/images/foo.png
. It teaches good conventions and will help improve SK's already-good DX.Alternatives considered
No response
Importance
nice to have
Additional Information
No response