11ty / api-indieweb-avatar

Return an optimized avatar image from a domain name input.
https://v1.indieweb-avatar.11ty.dev/
65 stars 11 forks source link
eleventy eleventy-api

11ty Logo

IndieWeb Avatar API

A runtime service to extract avatar images from:

  1. <link rel="apple-touch-icon">
  2. <link rel="apple-touch-icon-precomposed">
  3. <link rel="icon">
  4. favicon.ico (added September 20, 2021)
  5. favicon.ico that isn’t an .ico file (added December 1, 2023)
  6. First <img> in <header> (added December 1, 2023)
  7. TODO: Support Data URIs in attribute values. (e.g. https://joshcrain.io)
  8. TODO: <link rel="mask-icon">
  9. TODO (maybe): <link rel="manifest">
  10. TODO (maybe): <meta name="msapplication-config">

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

Update July 22, 2024: Supports svg favicons but converts to png for performance reasons (some folks had huge SVG favicons).

Usage

URLs have the formats:

/:url/