diff options
| author | kj_sh604 | 2026-03-31 18:29:10 -0400 |
|---|---|---|
| committer | kj_sh604 | 2026-03-31 18:29:10 -0400 |
| commit | 9312014ad56607b1b890db261b8079e968d9f656 (patch) | |
| tree | 95e8a6190937902a64d2d090475d129ece96ad9f /src | |
| parent | 21700a35595c2ab5c28ab4ee007d8796d78df88a (diff) | |
refactor: add favicon
Diffstat (limited to 'src')
| -rw-r--r-- | src/favicon.svg | 25 | ||||
| -rw-r--r-- | src/index.html | 1 | ||||
| -rw-r--r-- | src/server.py | 16 |
3 files changed, 42 insertions, 0 deletions
diff --git a/src/favicon.svg b/src/favicon.svg new file mode 100644 index 0000000..efda2dc --- /dev/null +++ b/src/favicon.svg @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --> + +<svg + width="800px" + height="800px" + viewBox="0 0 16 16" + fill="none" + version="1.1" + id="svg2" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <defs + id="defs2" /> + <path + d="M10 0H6V3H10V0Z" + fill="#000000" + id="path1" + style="fill:#7e9bc6;fill-opacity:1" /> + <path + d="M4 2H2V16H14V2H12V5H4V2Z" + fill="#000000" + id="path2" + style="fill:#7e9bc6;fill-opacity:1" /> +</svg> diff --git a/src/index.html b/src/index.html index d0203bc..dbac2f6 100644 --- a/src/index.html +++ b/src/index.html @@ -9,6 +9,7 @@ <meta http-equiv="expires" content="0"> <meta http-equiv="pragma" content="no-cache"> <title>kj-clipboard</title> + <link rel="icon" type="image/svg+xml" href="/favicon.svg"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kj-sh604/noir.css@latest/out/noir.min.css"> <style> textarea { diff --git a/src/server.py b/src/server.py index 8fc0235..e82406c 100644 --- a/src/server.py +++ b/src/server.py @@ -579,6 +579,7 @@ def paste_page(paste): <meta name="color-scheme" content="light dark"> <meta name="robots" content="noindex, nofollow"> <title>kj-clipboard - {paste_id}</title> + <link rel="icon" type="image/svg+xml" href="/favicon.svg"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kj-sh604/noir.css@latest/out/noir.min.css"> {highlight_css} </head> @@ -632,6 +633,7 @@ def not_found_page(): <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="color-scheme" content="light dark"> <title>kj-clipboard - not found</title> + <link rel="icon" type="image/svg+xml" href="/favicon.svg"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kj-sh604/noir.css@latest/out/noir.min.css"> </head> <body> @@ -809,6 +811,20 @@ class ClipboardHandler(http.server.BaseHTTPRequestHandler): self.wfile.write(data) return + if path == "/favicon.svg": + icon_path = BASE_DIR / "favicon.svg" + if not icon_path.exists(): + self.send_plain(404, "not found") + return + data = icon_path.read_bytes() + self.send_response(200) + self.send_header("Content-Type", "image/svg+xml") + self.send_header("Content-Length", str(len(data))) + self.add_security_headers() + self.end_headers() + self.wfile.write(data) + return + if path.startswith("/raw/"): paste_id = path[5:] if not is_valid_paste_id(paste_id): |
