跳转到导航 跳转到主要内容
CNB版本
社区版
cnb.cool
国外版
cnb.build
2025/12/30

IndieWeb 头像

本页大纲

Feed this runtime service a URL and it will extract an avatar image using these sources:

  1. <link rel="apple-touch-icon">
  2. <link rel="apple-touch-icon-precomposed">
  3. <link rel="icon">
  4. favicon.ico
  5. favicon.ico that isn’t an .ico file
  6. First <img> in <header>

All rel lookups match against attribute values that are space separated lists.

Open Source

Usage

Try it out on the Eleventy API Explorer.

Image URLs have the format:

https://avatar.w3c.cool/:url/
  • url must be URI encoded.

Samples

IndieWeb Avatar for blog.w3c.cool/ IndieWeb Avatar for a11yproject.com/ IndieWeb Avatar for netlify.com/
<img
	src="/img/default-avatar.svg"
	alt="IndieWeb Avatar for blog.w3c.cool/"
	loading="lazy"
	width="50"
	height="50"
/>
<img
	src="/img/default-avatar.svg"
	alt="IndieWeb Avatar for a11yproject.com/"
	loading="lazy"
	width="50"
	height="50"
/>
<img
	src="/img/default-avatar.svg"
	alt="IndieWeb Avatar for netlify.com/"
	loading="lazy"
	width="50"
	height="50"
/>

其他页面在 Runtime APIs