From e974eb6f3feb06c8951f85c1d34161938905f807 Mon Sep 17 00:00:00 2001 From: grm Date: Sat, 12 Sep 2026 19:47:28 +0300 Subject: Add a favicon and rework the Design page Blogs had no icon at all, and browsers probing /favicon.ico ended up rendering the 404 page. Ship a default paper & ink icon (svg + png) and let each blog replace it from the Design page; /favicon.ico now serves the default or redirects to the blog's own image. ICO uploads accepted. The Design page gains colour schemes, reset to defaults, thumbnail image pickers, jump links and a sticky save bar, plus new options: heading font, link underline/hover, content box style and padding, header image height, post dates and format, footer RSS toggle, menu alignment/style/hover and sidebar width. The Menu card picks the position with illustrated tiles and shows only the options that apply to it, using CSS :checked rules rather than JavaScript. All new defaults reproduce the previous look, so existing blogs are unchanged until edited. Theme is jsonb, so no migration. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/static/blog.css | 2 +- internal/web/static/dashboard.css | 46 ++++++++++++++++++++++++++++++++++++-- internal/web/static/favicon.png | Bin 0 -> 199 bytes internal/web/static/favicon.svg | 5 +++++ 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 internal/web/static/favicon.png create mode 100644 internal/web/static/favicon.svg (limited to 'internal/web/static') diff --git a/internal/web/static/blog.css b/internal/web/static/blog.css index a3695ae..778c169 100644 --- a/internal/web/static/blog.css +++ b/internal/web/static/blog.css @@ -47,7 +47,7 @@ img { max-width: 100%; height: auto; } /* left sidebar layout: float the menu beside the content */ .nav-left-sidebar .body-wrap .site-nav { float: left; width: 180px; border: 0; border-radius: 6px; padding: 0.5em 0; } .nav-left-sidebar .body-wrap .site-nav a { display: block; padding: 0.4em 1em; } -.nav-left-sidebar .body-wrap .site-nav .nav-inner { padding: 0; } +.nav-left-sidebar .body-wrap .site-nav .nav-inner { padding: 0; text-align: left; } /* alignment is a horizontal-menu option */ .nav-left-sidebar .body-wrap .content { margin-left: 200px; } .nav-left-sidebar .body-wrap .sidebar-notices { float: left; clear: left; width: 180px; margin-top: 1em; } .nav-left-sidebar .body-wrap .sidebar-notices .notice { font-size: 0.9em; padding: 0.6em 0.8em; } diff --git a/internal/web/static/dashboard.css b/internal/web/static/dashboard.css index c3d1420..4ea0d43 100644 --- a/internal/web/static/dashboard.css +++ b/internal/web/static/dashboard.css @@ -125,14 +125,56 @@ details.help[open] summary { margin-bottom: 0.5em; } .thumb .meta { font-size: 0.85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 0.4em; } .thumb .copy { font-size: 0.75em; margin: 0.4em 0; padding: 0.3em; font-family: "IBM Plex Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace; } .imagepick { margin-top: 0.5em; padding-top: 0.5em; border-top: 2px dashed #ddd6c7; } -.imagepick img.preview { display: block; max-width: 240px; max-height: 120px; margin-top: 0.4em; border: 2px solid #1d1a17; } -.imagepick select { width: auto; max-width: 100%; } +.imagepick > label { margin-bottom: 0.3em; } +.imagepick .picks { overflow: hidden; margin: 0.4em 0 0; } +.imagepick .pick { float: left; width: 120px; margin: 0 0.7em 0.7em 0; padding: 0.35em; border: 2px solid #ddd6c7; background: #fffdf8; text-align: center; font-size: 0.75em; text-transform: none; letter-spacing: 0; cursor: pointer; } +.imagepick .pick:hover { border-color: #1d1a17; } +.imagepick .pick input { display: block; width: auto; margin: 0 auto 0.3em; } +.imagepick .pick img, .imagepick .pick .swatch { display: block; width: 100%; height: 64px; margin: 0 auto 0.3em; border: 1px solid #ddd6c7; background: #f4efe4; } +.imagepick .pick img { object-fit: contain; } +.imagepick .pick .swatch { line-height: 64px; font-size: 1.6em; color: #b8b0a3; } +.imagepick .pick .name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.imagepick .pick input:checked ~ img, .imagepick .pick input:checked ~ .swatch { border: 3px solid #c8541a; } + +/* ---- design page ---------------------------------------------------------- */ +.jumps { margin: 0 0 1.2em; font-family: "IBM Plex Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.05em; } +.jumps a { display: inline-block; margin: 0 0.8em 0.3em 0; color: #1d1a17; text-decoration: none; border-bottom: 2px solid #ddd6c7; } +.jumps a:hover { border-color: #c8541a; } +.presets { overflow: hidden; } +.presets .preset { float: left; width: 8.5em; margin: 0 0.9em 0.9em 0; padding: 0.45em; background: #fffdf8; color: #1d1a17; font-size: 0.8em; text-align: center; } +.presets .preset:hover { background: #ebe5d6; color: #1d1a17; } +.presets .sw { display: inline-block; width: 22%; height: 2.2em; margin: 0 1%; border: 1px solid rgba(0,0,0,0.25); vertical-align: middle; } +.presets .pname { display: block; margin-top: 0.4em; } +/* menu position tiles + options that only apply to one layout; the show/hide is + pure CSS (:checked ~), and browsers without it simply show everything */ +.navpos { overflow: hidden; } +.navpos > input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; } +.navpos .tile { float: left; width: 8.5em; margin: 0.3em 0.9em 0.9em 0; padding: 0.5em 0.4em 0.4em; border: 2px solid #ddd6c7; background: #fffdf8; text-align: center; cursor: pointer; font-size: 0.75em; } +.navpos .tile svg { display: block; width: 80px; height: 56px; margin: 0 auto 0.4em; border: 1px solid #ddd6c7; } +.navpos .tile span { display: block; } +.navpos .tile:hover { border-color: #1d1a17; } +.navpos > input:checked + .tile { border-color: #c8541a; box-shadow: 3px 3px 0 #c8541a; } +.navpos > input:focus + .tile { outline: 2px solid #c8541a; outline-offset: 1px; } +.navpos .only-horizontal, .navpos .only-sidebar { clear: both; } +#np-side:checked ~ .only-horizontal { display: none; } +#np-below:checked ~ .only-sidebar, #np-top:checked ~ .only-sidebar { display: none; } +.hoverpick { margin: 0.8em 0; } +.hoverpick > input { width: auto; margin: 0 0.4em 0 0; vertical-align: middle; } +.hoverpick > label.check { display: inline; margin: 0; } +.hoverpick .hover-color { margin: 0.4em 0 0 1.6em; } +.hoverpick > input:not(:checked) ~ .hover-color { display: none; } +.savebar { position: sticky; bottom: 0; margin: 0 4px 0 0; padding: 0.8em 0; background: #f4efe4; border-top: 2px solid #1d1a17; } +.savebar .btn { margin-left: 0.8em; } +details.reset { margin-top: 1.6em; } /* ---- login --------------------------------------------------------------- */ .login-brand { text-align: center; font-family: "IBM Plex Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace; text-transform: uppercase; letter-spacing: 0.2em; margin: 2em 0 1em; } @media (max-width: 700px) { .cols .card, .row label, .thumb { float: none; width: auto; margin-right: 4px; } + .imagepick .pick { width: 46%; margin-right: 4%; } + .presets .preset { width: 46%; margin-right: 4%; } + .navpos .tile { width: 30%; margin-right: 3%; } .cols .card + .card { margin-right: 4px; } .topbar .links { float: none; display: block; margin-top: 0.3em; } .topbar .links a, .topbar .links form { margin-left: 0; margin-right: 1em; } diff --git a/internal/web/static/favicon.png b/internal/web/static/favicon.png new file mode 100644 index 0000000..26d45d4 Binary files /dev/null and b/internal/web/static/favicon.png differ diff --git a/internal/web/static/favicon.svg b/internal/web/static/favicon.svg new file mode 100644 index 0000000..5d44fd7 --- /dev/null +++ b/internal/web/static/favicon.svg @@ -0,0 +1,5 @@ + + + + + -- cgit v1.2.3