Skip to content

Commit

Permalink
add temporary debug statements for web build
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoreilly committed Dec 23, 2024
1 parent 8e31358 commit 85fd587
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pages/generatehtml.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
func init() {
// We override the OnChildAdded set in core/generatehtml.go
core.ExternalParent.AsWidget().SetOnChildAdded(func(n tree.Node) {
fmt.Println("oka")
var pg *Page
n.AsTree().WalkDown(func(n tree.Node) bool {
if pg != nil {
Expand All @@ -39,12 +40,14 @@ func init() {
fmt.Println(core.GenerateHTML(n.(core.Widget))) // basic fallback
os.Exit(0)
}
fmt.Println("pg", pg)
data := &ppath.PreRenderData{
Description: map[string]string{},
HTML: map[string]string{},
}
pg.UpdateTree() // need initial update first
for u := range pg.urlToPagePath {
fmt.Println("open", u)
pg.OpenURL("/"+u, false)
data.HTML[u] = core.GenerateHTML(pg)
desc := ""
Expand All @@ -64,6 +67,7 @@ func init() {
})
data.Description[u] = desc
}
fmt.Println("done")
fmt.Println(string(errors.Log1(jsonx.WriteBytes(data))))
})
}

0 comments on commit 85fd587

Please sign in to comment.