Static resource files can provide under /static directory. Like:
/static
- /logo # logo file
- /icon # icons
- /font # web fonts
- /image # images
- /media # medias, like video and radio
- /other # other static files
Add logo can easy add a logo.svg file to <root> directory. At development, the file can used as favico, they will inject a simple <link> tag to <head>:
At production, Use favicons to generate more kinds of favicons, output to <outroot>/static/logo directory. It also inject <link> for generated file to html.
The logo entrypoint default resolved by /<root>\/logo.(svg|png|jpg)$/, If not found, keep to find <root>/favicon.ico. If also not found, fallback to use waya logo.
I recommend to use logo.svg, If you want to display for yor app.
The logo svg file will transform to tsx based component. Other formats transform to base64 data url. For example:
importLogofrom'@/logo.svg'
functionHeader(){
return<Logo />
}
importLogofrom'@/logo.png'
functionHeader(){
return<imgsrc={Logo} />
}
Hot reload was supported.
Badges
If you want can set badges to favico at runtime. The BadgeContext provide a context help to setup badges. You can use BadgeProvider and useBadge hook to update badges value. For example: