From aa23774abb90c168c9ba2559d6bf381bc9fc55ba Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 31 Mar 2026 10:44:10 +0000 Subject: Add post management admin UI and switch to modernc.org/sqlite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace custom CGO sqlite driver with modernc.org/sqlite (registered as "sqlite3"); a local compat shim under compat/sqlite/ provides the same import path and WAL-mode behaviour using system libsqlite3 while network access is unavailable — swapping to the real pure-Go package later only requires removing the replace directive and running go get. - Add internal/admin/server.go: HTTP handler for /admin/ that serves a server-side-rendered post management UI (list, new, edit, delete). Posts are stored as Markdown files under content/posts/ and rebuilt via the existing Builder after every write. Basic auth is checked against the .passwords file when it exists. - Add cmd/nebbet/main.go: unified CLI with build, watch, serve (HTTP server with admin + file server + watch), and user subcommands. - Update builder.BuildAll to skip content/admin/ — admin pages are served dynamically and must never appear in the static output directory. - Mark content/admin/index.md as draft so the old static placeholder is not built even if the admin skip logic is bypassed. - Fix .gitignore: use /nebbet (root-only) so the pattern no longer accidentally ignores the cmd/nebbet/ source directory. https://claude.ai/code/session_01WLuSGxJhNs2cFM2zJzSsTx --- internal/builder/builder.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal/builder') diff --git a/internal/builder/builder.go b/internal/builder/builder.go index 40be377..59bb71b 100644 --- a/internal/builder/builder.go +++ b/internal/builder/builder.go @@ -62,6 +62,11 @@ func (b *Builder) BuildAll() error { if err != nil || d.IsDir() || !strings.HasSuffix(path, ".md") { return err } + // Skip content/admin/ — served dynamically by the admin HTTP server. + rel, _ := filepath.Rel(b.ContentDir, path) + if strings.HasPrefix(filepath.ToSlash(rel), "admin/") || filepath.ToSlash(rel) == "admin" { + return nil + } return b.BuildFile(path, importMap) }) } -- cgit v1.3