favicon
它能做什么
这项技能检查网站是否为其页面显示了正确的小图标。适用于希望品牌在标签页和搜索结果中易于识别的网站所有者。
适用场景
- ✓当你的网站在浏览器标签页中显示空白或默认图标的时候。
- ✓当你搭建新网站或新的页面模板的时候。
- ✓当你的网站在搜索结果中没有显示图标的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/favicon/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请检查我的网站每个页面是否都有正确的 favicon?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查页面头部的图标链接标签,并确认图标文件可以通过 HTTPS 访问。它会建议要添加的文件格式和尺寸。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Add a favicon to every page
Google displays favicons next to search results on mobile devices, making your brand immediately recognisable in the SERP. A missing or inaccessible favicon prevents Google from showing it, reducing visual brand presence in search.
Quick Reference
- Provide a
<link rel="icon">pointing to a favicon file; Google uses it to identify your site in search results - Serve the favicon via HTTPS, ensure it is publicly accessible (not blocked by robots.txt), and at least 48×48px for Google's use
- Include both an ICO fallback and SVG/PNG versions for broad browser and device compatibility
Check
In the page <head>, look for <link rel="icon"> or <link rel="shortcut icon"> elements. Verify: (1) The href points to an accessible URL (returns 200, not blocked by robots.txt). (2) The file is at least 48×48px (for Google Search use). (3) A PNG or SVG version is provided alongside the ICO fallback. (4) The favicon is accessible over HTTPS.
Fix
- Create favicon files:
favicon.ico(16×16 and 32×32, ICO format) — legacy browser fallbackfavicon.svg(scalable, modern browsers)apple-touch-icon.png(180×180 PNG) — iOS home screen
- Place them in the root or
/publicdirectory. - Add to
<head>:<link rel="icon" href="/favicon.ico" sizes="any"> <link rel="icon" href="/favicon.svg" type="image/svg+xml"> <link rel="apple-touch-icon" href="/apple-touch-icon.png"> - Verify the favicon URL returns a 200 response (not 404).
- Check that /robots.txt does not block the favicon path.
- Test Google's display using the URL Inspection tool in Search Console.
Explain
Favicons appear next to your site's name in browser tabs, bookmarks, and Google Search mobile results. Google explicitly states it uses the favicon from <link rel='icon'> for display in search results. A missing, blocked, or too-small favicon means Google cannot show your brand icon, reducing search result click-through rate.
Code Review
Check the <head> for <link rel='icon'> and <link rel='apple-touch-icon'>. Verify the href values are valid relative or absolute paths. Confirm the favicon files exist and return HTTP 200. Flag if only favicon.ico at site root is used without an explicit <link> element (relying on browser default discovery is less reliable).
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
常见问题
推荐什么尺寸?
这项技能指出,用于 Google 搜索的图标至少应为 48 x 48 像素。
它建议哪些文件?
它建议使用 ICO 备用文件、SVG 图标,以及用于 iPhone 主屏幕的 180 x 180 像素 PNG。
为什么图标必须可以访问?
如果图标被 robots.txt 屏蔽或无法公开访问,Google 就无法显示它。
详情
作者的原始描述
Use when checking whether a site has a correctly configured favicon, auditing `<link rel='icon'>` tags in the `<head>`, or setting up favicon infrastructure for a new project.
热度
- GitHub 星标
- 75k
- 排名
- #2840
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。