feat(server): add owner-tools injection and inline code theme CSS

- Add owner-tools serving and injection for blog owners
- Inline code theme CSS in templates for soft reload support
- Update import paths from github.com/writekitapp to writekit
- Add optional session middleware for owner detection
- Update platform index with improved UI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Josh 2026-01-12 02:02:13 +02:00
parent 771ff7615a
commit 119e3b7a6d
11 changed files with 838 additions and 483 deletions

View file

@ -8,9 +8,9 @@ import (
"sync"
"time"
"github.com/writekitapp/writekit/internal/build/templates"
"github.com/writekitapp/writekit/internal/markdown"
"github.com/writekitapp/writekit/internal/tenant"
"writekit/internal/tenant/templates"
"writekit/internal/markdown"
"writekit/internal/tenant"
)
type renderedPage struct {
@ -39,14 +39,16 @@ func (s *Server) rebuildSite(ctx context.Context, tenantID string, db *sql.DB, h
codeTheme := getSettingOr(settings, "code_theme", "github")
fontKey := getSettingOr(settings, "font", "system")
isDemo := getSettingOr(settings, "is_demo", "") == "true"
codeThemeCSS, _ := markdown.GenerateChromaCSS(codeTheme)
pageData := templates.PageData{
SiteName: siteName,
Year: time.Now().Year(),
FontURL: templates.GetFontURL(fontKey),
FontFamily: templates.GetFontFamily(fontKey),
Settings: settingsToMap(settings),
NoIndex: isDemo,
SiteName: siteName,
Year: time.Now().Year(),
FontURL: templates.GetFontURL(fontKey),
FontFamily: templates.GetFontFamily(fontKey),
Settings: settingsToMap(settings),
NoIndex: isDemo,
CodeThemeCSS: template.CSS(codeThemeCSS),
}
var pages []renderedPage