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

@ -96,7 +96,7 @@ func main() {
for _, def := range ast.Definitions {
if def.Page != nil {
pageCount++
totalContent := len(def.Page.Meta) + len(def.Page.Sections) + len(def.Page.Components)
totalContent := len(def.Page.Meta) + len(def.Page.Elements)
if totalContent > 0 {
fmt.Printf(" ✓ Page '%s' has %d content items (block syntax working)\n", def.Page.Name, totalContent)
}
@ -110,9 +110,11 @@ func main() {
var totalSections, nestedSections int
for _, def := range ast.Definitions {
if def.Page != nil {
totalSections += len(def.Page.Sections)
for _, section := range def.Page.Sections {
nestedSections += countNestedSections(section)
for _, element := range def.Page.Elements {
if element.Section != nil {
totalSections++
nestedSections += countNestedSections(*element.Section)
}
}
}
}