Add favicon upload to the site editor

Data.favicon names a blob in the content-addressed files store (no
migration: msgspec default). PUT/DELETE /_api/settings/favicon upload and
clear it; when set, every page links it as <link rel="icon">, otherwise
browsers fall back to the build's /favicon.ico. SiteEditor shows a preview
with upload/replace/remove and applies the change to the live page head.
This commit is contained in:
2026-08-18 05:22:25 +00:00
parent d03ee7fa8f
commit c0817330e7
5 changed files with 170 additions and 9 deletions
+3
View File
@@ -86,6 +86,9 @@ class Data(msgspec.Struct):
#: Raw site-wide custom CSS, injected inline in every page <head>.
#: Trusted author content; not sanitized.
custom_css: str = ""
#: Favicon: name of a file in `files` (content-addressed), linked as
#: <link rel="icon"> on every page. Empty = the build's /favicon.ico.
favicon: str = ""
#: Legacy flat page store (pre-tree databases); migrated into `menu`
#: on startup, then cleared. Never written otherwise.
pages: dict[str, Page] = {}