allow for sections and components in any order on pages

This commit is contained in:
2025-09-09 22:30:00 -06:00
parent 88d757546a
commit b82e22c38d
11 changed files with 1179 additions and 848 deletions

View File

@ -122,15 +122,20 @@ type ResponseSpec struct {
// Page Enhanced Page definitions with unified section model
type Page struct {
Name string `parser:"'page' @Ident"`
Path string `parser:"'at' @String"`
Layout string `parser:"'layout' @Ident"`
Title *string `parser:"('title' @String)?"`
Description *string `parser:"('desc' @String)?"`
Auth bool `parser:"@'auth'?"`
Meta []MetaTag `parser:"('{' @@*"` // Block-delimited content
Sections []Section `parser:"@@*"` // Unified sections replace containers/tabs/panels/modals
Components []Component `parser:"@@* '}')?"` // Direct components within the block
Name string `parser:"'page' @Ident"`
Path string `parser:"'at' @String"`
Layout string `parser:"'layout' @Ident"`
Title *string `parser:"('title' @String)?"`
Description *string `parser:"('desc' @String)?"`
Auth bool `parser:"@'auth'?"`
Meta []MetaTag `parser:"('{' @@*"` // Block-delimited content
Elements []PageElement `parser:"@@* '}')?"` // Unified elements allowing any order
}
// PageElement Unified element type for pages allowing sections and components in any order
type PageElement struct {
Section *Section `parser:"@@"`
Component *Component `parser:"| @@"`
}
// MetaTag Meta tags for SEO