allow for sections and components in any order on pages
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user