跳到正文
Skillpedia
品牌75k · #2840

favicon

它能做什么

这项技能检查网站是否为其页面显示了正确的小图标。适用于希望品牌在标签页和搜索结果中易于识别的网站所有者。

适用场景

  • ✓当你的网站在浏览器标签页中显示空白或默认图标的时候。
  • ✓当你搭建新网站或新的页面模板的时候。
  • ✓当你的网站在搜索结果中没有显示图标的时候。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/favicon/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/favicon/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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

  1. Create favicon files:
    • favicon.ico (16×16 and 32×32, ICO format) — legacy browser fallback
    • favicon.svg (scalable, modern browsers)
    • apple-touch-icon.png (180×180 PNG) — iOS home screen
  2. Place them in the root or /public directory.
  3. 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">
    
  4. Verify the favicon URL returns a 200 response (not 404).
  5. Check that /robots.txt does not block the favicon path.
  6. 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.

Rule page: https://frontendchecklist.io/rules/seo/favicon

常见问题

推荐什么尺寸?

这项技能指出,用于 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.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2840
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能