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/templates/blog/page.html | 2 +- internal/web/templates/blog/post.html | 2 +- internal/web/templates/dashboard/design.html | 138 ++++++++++++++++++++++--- internal/web/templates/dashboard/images.html | 2 +- internal/web/templates/layouts/blog.html | 7 +- internal/web/templates/layouts/dashboard.html | 2 + internal/web/templates/partials/imagepick.html | 16 ++- 7 files changed, 141 insertions(+), 28 deletions(-) (limited to 'internal/web/templates') diff --git a/internal/web/templates/blog/page.html b/internal/web/templates/blog/page.html index c1fe726..ba78ff6 100644 --- a/internal/web/templates/blog/page.html +++ b/internal/web/templates/blog/page.html @@ -5,7 +5,7 @@ {{range .Data.posts}}

{{.Title}}

- + {{if $.Data.theme.ShowDates}}{{end}}
{{html .BodyHTML}}
{{else}}{{if not .Data.page.IntroHTML}}

Nothing here yet.

{{end}}{{end}} diff --git a/internal/web/templates/blog/post.html b/internal/web/templates/blog/post.html index 83ce782..5fa8ca4 100644 --- a/internal/web/templates/blog/post.html +++ b/internal/web/templates/blog/post.html @@ -2,7 +2,7 @@ {{define "content"}}

{{.Data.post.Title}}

- +
{{html .Data.post.BodyHTML}}
{{end}} diff --git a/internal/web/templates/dashboard/design.html b/internal/web/templates/dashboard/design.html index 09ea1fe..af482fe 100644 --- a/internal/web/templates/dashboard/design.html +++ b/internal/web/templates/dashboard/design.html @@ -1,12 +1,29 @@ {{define "title"}}Design · {{.Blog.Title}}{{end}} {{define "content"}} {{$t := .Data.theme}} -

Design

-

Save, then refresh your blog ↗ to see the result. Colours are hex values like #336699.

+
+

Design

+

Changes are live as soon as you save; refresh your blog ↗ to see them.

+
+

SchemesBackgroundTextHeaderMenuPostsFooterIcon

+ +
+

Colour schemes

+

A quick start: applying a scheme sets every colour below and saves immediately. Images, fonts and layout are kept.

+
+ + {{range .Data.presets}} + {{end}} +
+
+
-
+

Background

@@ -19,33 +36,60 @@ {{template "imagepick" (dict "name" "bg_image" "current" $t.BgImage "images" .Data.images "label" "Background image")}}
-
+

Text & content area

+
+ + + +
+ + +
+
+ +
-
+ -
+ -
+
+

Posts & dates

+ +
+ +
+
+ + + +
+

Site icon

+ {{template "imagepick" (dict "name" "favicon" "current" $t.Favicon "images" .Data.images "label" "Favicon" "hint" "The small icon browsers show in the tab. A square PNG or ICO of 32–64 px works best; pick None for the Blogspace icon." "accept" "image/png,image/x-icon,image/gif,image/webp,image/jpeg,.ico")}}
-

+
+ + View blog ↗ +
+ +
+ Reset to defaults +

Puts every colour, font and layout option back to how a new blog starts and forgets the chosen images (they stay in your library).

+
+ + +
+
{{end}} diff --git a/internal/web/templates/dashboard/images.html b/internal/web/templates/dashboard/images.html index b44289e..1c64391 100644 --- a/internal/web/templates/dashboard/images.html +++ b/internal/web/templates/dashboard/images.html @@ -7,7 +7,7 @@
- +

diff --git a/internal/web/templates/layouts/blog.html b/internal/web/templates/layouts/blog.html index ac6595b..3447e1f 100644 --- a/internal/web/templates/layouts/blog.html +++ b/internal/web/templates/layouts/blog.html @@ -5,7 +5,10 @@ {{block "title" .}}{{.Blog.Title}}{{end}} - +{{if .Data.theme.Favicon}} +{{else}} + +{{end}} @@ -29,7 +32,7 @@ diff --git a/internal/web/templates/layouts/dashboard.html b/internal/web/templates/layouts/dashboard.html index 6633c29..e724cc6 100644 --- a/internal/web/templates/layouts/dashboard.html +++ b/internal/web/templates/layouts/dashboard.html @@ -4,6 +4,8 @@ {{block "title" .}}Blogspace{{end}} + + diff --git a/internal/web/templates/partials/imagepick.html b/internal/web/templates/partials/imagepick.html index 687c6cd..0c6eced 100644 --- a/internal/web/templates/partials/imagepick.html +++ b/internal/web/templates/partials/imagepick.html @@ -1,11 +1,9 @@ {{define "imagepick"}}
- - - {{if .current}} - {{end}} + + {{if .hint}}

{{.hint}}

{{end}} +
+ + {{range .images}}{{end}} +
+
{{end}} -- cgit v1.2.3