网站图标
🌐 Favicon
Strapi 的 管理面板 会在多个地方显示其品牌标识,包括 徽标 和网站图标。替换这些图片可以让你将界面和应用与你的身份相匹配。
🌐 Strapi's admin panel displays its branding on various places, including the logo and the favicon. Replacing these images allows you to match the interface and application to your identity.
更换网站图标有两种方法:
🌐 There are 2 approaches to replacing the favicon:
-
替换 Strapi 项目根目录下的
favicon.png文件 -
用以下代码编辑
strapi::favicon中间件配置:/config/middlewares.js// …
{
name: 'strapi::favicon',
config: {
path: 'my-custom-favicon.png',
},
},
// …
完成后,通过在终端运行 yarn build && yarn develop 来重建、启动并重新访问你的 Strapi 应用。
🌐 Once done, rebuild, launch and revisit your Strapi app by running yarn build && yarn develop in the terminal.
确保清除缓存的收藏夹图标。它可能缓存于你的网页浏览器中,也可能缓存于像 Cloudflare 的 CDN 这样的域名管理工具中。
🌐 Make sure that the cached favicon is cleared. It can be cached in your web browser and also with your domain management tool like Cloudflare's CDN.