Add page management to the structured editor

Pages can now be reordered, renamed, and have their metadata edited
without touching YAML.

- Up/down arrows next to each page in the /edit list to reorder.
- "Settings" button per page opens /edit/pages/{slug}/settings — a
  form covering name, slug, page width, desktop nav width, mobile
  header, hide desktop nav, center vertically.
- POST /edit/api/pages/{slug}/fields applies metadata changes
  surgically via the existing yaml.Node + atomic-save flow so
  columns/widgets/comments stay untouched.
- POST /edit/api/pages/{slug}/move?dir=up|down swaps adjacent pages.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
uhlwoogi
2026-04-30 17:18:52 +00:00
co-authored by Claude Opus 4.7
parent 8ba6dcb704
commit 7f36f30dad
6 changed files with 270 additions and 4 deletions
+3
View File
@@ -454,6 +454,7 @@ func (a *application) server() (func() error, func() error) {
mux.HandleFunc("GET /edit", a.handleAdminIndex)
mux.HandleFunc("GET /edit/pages/{page}", a.handleAdminPage)
mux.HandleFunc("GET /edit/pages/{page}/settings", a.handleAdminPageSettings)
mux.HandleFunc("GET /edit/pages/{page}/widgets/{col}/{idx}", a.handleAdminWidget)
mux.HandleFunc("POST /edit/api/pages", a.handleAdminAddPage)
@@ -474,6 +475,8 @@ func (a *application) server() (func() error, func() error) {
mux.HandleFunc("POST /edit/api/pages/{page}/columns/{col}/delete", a.handleAdminDeleteColumn)
mux.HandleFunc("POST /edit/api/pages/{page}/columns/{col}/move", a.handleAdminMoveColumn)
mux.HandleFunc("POST /edit/api/pages/{page}/columns/{col}/size", a.handleAdminColumnSize)
mux.HandleFunc("POST /edit/api/pages/{page}/fields", a.handleAdminUpdatePageFields)
mux.HandleFunc("POST /edit/api/pages/{page}/move", a.handleAdminMovePage)
if a.RequiresAuth {
mux.HandleFunc("GET /login", a.handleLoginPageRequest)