Migrate all apps to defpage declarative page routes
Replace Python GET page handlers with declarative defpage definitions in .sx files across all 8 apps (sx docs, orders, account, market, cart, federation, events, blog). Each app now has sxc/pages/ with setup functions, layout registrations, page helpers, and .sx defpage declarations. Core infrastructure: add g I/O primitive, PageDef support for auth/layout/ data/content/filter/aside/menu slots, post_author auth level, and custom layout registration. Remove ~1400 lines of render_*_page/render_*_oob boilerplate. Update all endpoint references in routes, sx_components, and templates to defpage_* naming. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -120,6 +120,31 @@
|
||||
(defcomp ~header-child-sx (&key id inner)
|
||||
(div :id (or id "root-header-child") :class "flex flex-col w-full items-center" inner))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; Mobile menu — vertical nav sections for hamburger panel
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
||||
;; Labelled section: colour bar header + vertical nav items
|
||||
(defcomp ~mobile-menu-section (&key label href colour level items)
|
||||
(let* ((c (or colour "sky"))
|
||||
(lv (or level 1))
|
||||
(shade (str (- 500 (* lv 100)))))
|
||||
(div
|
||||
(div :class (str "flex items-center gap-2 px-3 py-1.5 text-sm font-bold bg-" c "-" shade)
|
||||
(if href
|
||||
(a :href href :class "hover:underline" label)
|
||||
(span label)))
|
||||
(div :class "flex flex-col gap-1 p-2 text-sm"
|
||||
items))))
|
||||
|
||||
;; Root-level mobile nav: site nav items + auth links
|
||||
(defcomp ~mobile-root-nav (&key nav-tree auth-menu)
|
||||
(<>
|
||||
(when nav-tree
|
||||
(div :class "flex flex-col gap-2 p-3 text-sm" nav-tree))
|
||||
(when auth-menu
|
||||
(div :class "p-3 border-t border-stone-200" auth-menu))))
|
||||
|
||||
(defcomp ~error-content (&key errnum message image)
|
||||
(div :class "text-center p-8 max-w-lg mx-auto"
|
||||
(div :class "font-bold text-2xl md:text-4xl text-red-500 mb-4" errnum)
|
||||
|
||||
Reference in New Issue
Block a user