From 0235c9a7870a4f39a4b9867656c005ad7bf00f9c Mon Sep 17 00:00:00 2001 From: yktsnet Date: Sun, 25 Oct 2026 20:38:45 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=94=9F=E6=88=90=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AB=20favicon=20=E3=82=92?= =?UTF-8?q?=E4=BB=98=E3=81=91=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 変更内容 - `build_style()` が `public/favicon.svg` を書き、各ページの head から読む(リンクは他と同じく相対パスに直る) - 図柄は Lucide の code。色は CSS の `--accent` と `--accent-soft` --- codeview/layout.py | 1 + codeview/style.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/codeview/layout.py b/codeview/layout.py index d80e9f1..535397a 100644 --- a/codeview/layout.py +++ b/codeview/layout.py @@ -71,6 +71,7 @@ def page( '' f"{html.escape(title)}" f'' + '' f"" f'' f'
{main}
' diff --git a/codeview/style.py b/codeview/style.py index 43a7efc..643358a 100644 --- a/codeview/style.py +++ b/codeview/style.py @@ -482,6 +482,15 @@ """ +FAVICON = ( + '' + '' + '' + '\n' +) + + def write(target: Path, content: str) -> None: target.parent.mkdir(parents=True, exist_ok=True) target.write_text(content, encoding="utf-8") @@ -494,4 +503,5 @@ def build_style(out_root: Path, extra_css: str = "") -> str: digest = hashlib.sha256(css.encode()).hexdigest()[:10] STYLE_HREF = f"/style.{digest}.css" write(out_root / f"style.{digest}.css", css) + write(out_root / "favicon.svg", FAVICON) return STYLE_HREF