A Cloudflare Worker that redirects to the og:image of any GitHub repository, organization, or user.
https://ghlogo.heathdutton.workers.dev/{owner}
https://ghlogo.heathdutton.workers.dev/{owner}/{repo}
| URL | Redirects to |
|---|---|
| /microsoft | Microsoft's org avatar |
| /microsoft/vscode | VS Code repo's social preview |
| /torvalds | Linus Torvalds' avatar |
| /torvalds/linux | Linux repo's social preview |
<img src="https://ghlogo.heathdutton.workers.dev/owner/repo" alt="Repo Logo">- Fetches the GitHub page for the given path
- Extracts the
<meta property="og:image">URL - Returns a 302 (temporary) redirect to that image - temporary because the og:image URL changes when owners update their social preview
- Caches the redirect in memory for 1 hour
The in-memory cache persists for the lifetime of the worker isolate, reducing latency for repeated requests.
# Clone
git clone https://github.com/heathdutton/ghlogo.git
cd ghlogo
# Install
npm install
# Test locally
npm run dev
# Deploy (requires wrangler auth)
npm run deployUpdate the name in wrangler.toml to use your own subdomain.
MIT