feat(favicon): serve project favicon reusing the header envelope logo

Serve an inline SVG icon at /favicon.svg and /favicon.ico and link it
from the shared Layout and the standalone entry view, so the admin UI,
status page, and entry pages stop emitting /favicon.ico 404s. Doubles
as the fallback for the upcoming per-feed favicon feature.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Julien Herr
2026-05-23 13:13:44 +02:00
parent a67baa71f4
commit d299c8891d
7 changed files with 89 additions and 7 deletions
+23
View File
@@ -0,0 +1,23 @@
import { Context } from "hono";
import { Env } from "../types";
export const FAVICON_PATH = "/favicon.svg";
// Project favicon — reuses the header's envelope logo (brand orange #f6821f),
// rendered as a white envelope on a rounded orange square for legibility at 16px.
export const FAVICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32">
<rect width="32" height="32" rx="7" fill="#f6821f"/>
<g fill="none" stroke="#ffffff" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<path d="M7 9h18c1.1 0 2 .9 2 2v10c0 1.1-.9 2-2 2H7c-1.1 0-2-.9-2-2V11c0-1.1.9-2 2-2z"/>
<polyline points="27,11 16,18.5 5,11"/>
</g>
</svg>`;
export function handle(_c: Context<{ Bindings: Env }>): Response {
return new Response(FAVICON_SVG, {
headers: {
"Content-Type": "image/svg+xml; charset=utf-8",
"Cache-Control": "public, max-age=86400",
},
});
}