Rename project from TopDeck to Canon
- Module github.com/cdnutter/canon, binary/command cmd/canon, Docker image and compose project "canon" - Environment variables now use the CANON_ prefix - Default site title is "<Your name>'s Canon" (or "Canon" with no name); a Site title set in Settings still overrides it - Existing topdeck.db (and WAL files) is renamed to canon.db on start - README: upgrade notes, including moving the old compose volume Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
58a29b7339
commit
3923444b3b
26 files changed
+215
-120
No files matched your search
@@ -11,8 +11,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/cdnutter/topdeck/internal/store"
|
||||
"github.com/cdnutter/topdeck/web"
|
||||
"github.com/cdnutter/canon/internal/store"
|
||||
"github.com/cdnutter/canon/web"
|
||||
)
|
||||
|
||||
// Site is the owner-configurable identity shown on every page.
|
||||
@@ -53,7 +53,7 @@ func (s *Server) site(ctx context.Context) Site {
|
||||
ShowNotes: set[store.SettingShowNotes] != "false",
|
||||
}
|
||||
if site.Title == "" {
|
||||
site.Title = "TopDeck"
|
||||
site.Title = DefaultTitle(site.OwnerName)
|
||||
}
|
||||
if !validTheme(site.Theme) {
|
||||
site.Theme = DefaultTheme
|
||||
@@ -71,6 +71,15 @@ func (s *Server) site(ctx context.Context) Site {
|
||||
return site
|
||||
}
|
||||
|
||||
// DefaultTitle is the site title when the owner hasn't set one:
|
||||
// "Chris's Canon", or just "Canon" before they've entered a name.
|
||||
func DefaultTitle(ownerName string) string {
|
||||
if ownerName = strings.TrimSpace(ownerName); ownerName == "" {
|
||||
return "Canon"
|
||||
}
|
||||
return ownerName + "'s Canon"
|
||||
}
|
||||
|
||||
func (s *Server) handleCustomCSS(w http.ResponseWriter, r *http.Request) {
|
||||
set, err := s.store.Settings(r.Context())
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user