Commit 7ad3de789e
7ad3de789eb7388381be33637ec3854cc4c7885b
parent: 728618a5da
Verified · cmc ci/build: success
cmc <hello@cleberg.net> · 2026-08-26 02:23 UTC
web: configurable instance title, footer aligned with content
[web] title sets the display name in the header and page titles; the
site host remains the fallback. The footer sits in the pane beside the
rail, so it takes the content's horizontal padding rather than none.
Layout: unified · split
internal/config/config.go
+3
| @@ -64,6 +64,9 @@ type GitDaemon struct { |
| 64 | type Web struct { |
64 | type Web struct { |
| 65 | Mode string `toml:"mode"` // view_only | accounts |
65 | Mode string `toml:"mode"` // view_only | accounts |
| 66 | PasswordAuth bool `toml:"password_auth"` |
66 | PasswordAuth bool `toml:"password_auth"` |
| |
67 | // Title is the instance's display name in the header and page titles. |
| |
68 | // Empty falls back to the site host. |
| |
69 | Title string `toml:"title"` |
| 67 | // PrivacyNotice is operator-provided text shown on /privacy under the |
70 | // PrivacyNotice is operator-provided text shown on /privacy under the |
| 68 | // fixed project-level statement. Plain text; blank paragraphs split. |
71 | // fixed project-level statement. Plain text; blank paragraphs split. |
| 69 | PrivacyNotice string `toml:"privacy_notice"` |
72 | PrivacyNotice string `toml:"privacy_notice"` |
internal/httpd/web.go
+5
| @@ -47,7 +47,12 @@ func (s *Server) render(w http.ResponseWriter, page string, data any) { |
| 47 | buf.WriteTo(w) |
47 | buf.WriteTo(w) |
| 48 | } |
48 | } |
| 49 | |
49 | |
| |
50 | // siteName is the instance's display name: the operator's [web] title, |
| |
51 | // or the site host when they have not set one. |
| 50 | func (s *Server) siteName() string { |
52 | func (s *Server) siteName() string { |
| |
53 | if t := strings.TrimSpace(s.cfg.Web.Title); t != "" { |
| |
54 | return t |
| |
55 | } |
| 51 | h := strings.TrimPrefix(strings.TrimPrefix(s.cfg.Server.SiteURL, "https://"), "http://") |
56 | h := strings.TrimPrefix(strings.TrimPrefix(s.cfg.Server.SiteURL, "https://"), "http://") |
| 52 | return strings.TrimSuffix(h, "/") |
57 | return strings.TrimSuffix(h, "/") |
| 53 | } |
58 | } |
internal/web/static/style.css
+3 −1
| @@ -1063,7 +1063,9 @@ button:hover { filter: brightness(1.15); } |
| 1063 | /* footer */ |
1063 | /* footer */ |
| 1064 | footer { |
1064 | footer { |
| 1065 | border-top: 1px solid var(--faint); |
1065 | border-top: 1px solid var(--faint); |
| 1066 | padding: var(--sp-4) 0; |
1066 | padding: var(--sp-4) var(--sp-5) var(--sp-5); |
| |
1067 | max-width: 78rem; |
| |
1068 | width: 100%; |
| 1067 | color: var(--muted); |
1069 | color: var(--muted); |
| 1068 | font-size: var(--fs-1); |
1070 | font-size: var(--fs-1); |
| 1069 | } |
1071 | } |