| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
Previously RenamePost + UpsertPost were two separate DB calls; a failure
between them left the post at the new slug with stale content. The new
RenameAndUpsertPost method does both in a single transaction.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement RenamePost method that atomically:
1. Fetches the post record by old slug
2. Inserts a new record with the new slug
3. Deletes the old slug post
4. Collapses redirect chains (updates any redirects pointing to oldSlug to point to newSlug)
5. Creates a redirect from oldSlug to newSlug
All operations are transactional (all-or-nothing). Includes two comprehensive tests:
- TestRenamePost: basic rename with redirect creation and old slug deletion
- TestRenamePost_CollapsesChain: verifies redirect chains are collapsed correctly
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove old ServeHTTP method (no longer needed with Gin routing)
- Update all 6 handler methods to use *gin.Context instead of http.ResponseWriter, *http.Request
- Convert handler signatures: handleList, handleNew, handleNewPost, handleEdit, handleDelete
- Remove render() helper (use c.HTML() directly)
- Update renderError() to accept gin.Context instead of http.ResponseWriter
- Update postFromForm() to extract form data from gin.Context using c.PostForm()
- Update main.go to use adminSrv.NewServer() and adminSrv.Engine()
- All handlers now use Gin methods: c.HTML(), c.PostForm(), c.Param(), c.Redirect()
- Path parameters now extracted via c.Param("slug") instead of function arguments
- HTTP status codes and error handling fully migrated to Gin patterns
Build verified: go build ./cmd/nebbet succeeds
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
- cmd/nebbet: CLI with build [--watch] and user add/passwd/delete/list
- internal/builder: markdown→HTML, component injection via HTML comments,
auto importmap from lib/, fsnotify watch with 150ms debounce
- internal/db: meta.db (page index, tag queries) + search.db (FTS5)
- internal/sqlitedrv: minimal CGO database/sql driver for system libsqlite3
- internal/auth: htpasswd-compatible bcrypt password file management
- templates/base.html + admin.html, styles/main.css + admin.css
- nginx.conf with auth_basic for /admin, clean URLs, gzip
- nebbet.service systemd unit for watch daemon
- Example content/index.md and components/site-greeting.js
https://claude.ai/code/session_01HTc1BCBCiMTEB54XQP1Wz9
|