Zach’s ugly mug (his face) Zach Leat­herman

IndieWeb Avatar, yet another Eleventy Image Service API

3k 147 September 20, 2021

The Eleventy API ecosystem is growing (again).

I use Twitter avatars everywhere. They require an Twitter Developer account and an API key to implement. They require the talent being pictured to have a Twitter account (not everyone does). I wanted a more open alternative. I decided to build a little image service that would fetch the icon from any web site, optimize it using Eleventy Image, and return that instead.

Demo

IndieWeb Avatar for 11ty.dev/ IndieWeb Avatar for a11yproject.com/ IndieWeb Avatar for netlify.com/ IndieWeb Avatar for arielsalminen.com IndieWeb Avatar for ashur.cab/rera/ IndieWeb Avatar for nicolas-hoizey.com/

If you want a live demo in the wild, check out the Eleventy Leaderboards (via Speedlify).

Source Code

Only one path parameter is supported right now: /[url]/ (must be encoded via e.g. encodeURIComponent)

My version is running on https://v1.indieweb-avatar.11ty.dev/ using the same versioning via Netlify Branch Subdomains strategy as the screenshot and sparkline services.

It makes use of Netlify’s On-Demand Builders to reduce the number of external HTTP requests to generate the images.

Deploy your own

Deploy to Netlify

Zach Leatherman IndieWeb Avatar for https://zachleat.com/is a builder for the web at Font Awesome and the creator of Build Awesome (née IndieWeb Avatar for https://www.11ty.devEleventy/11ty), an award-winning open source website generator. He measures website performance with speedlify and at one point became too fixated on web fonts. He has given 89 talks in nine different countries at events like Beyond Tellerrand, Smashing Conference, Jamstack Conf, CSSConf, and The White House. Formerly part of CloudCannon, Netlify, Filament Group, NEJS CONF, and NebraskaJS. Learn more about Zach »