Documentation ¶
Overview ¶
Copyright (C) 2024 early (LGPL)
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Page = page.New("ex01", "page.html", page.Includes(RandomGenerator, parts.SourcePreview), page.OnLoad(func(data render.Data) error { sources := make(render.Data) sources.Set("random_generator_html", include.File("random-generator.html")) sources.Set("random_generator_go", include.File("random-generator.go")) sources.Set("page", include.File("page.html")) sources.Set("go", include.File("example.go")) data.Set("sources", sources) return nil }), )
View Source
var RandomGenerator = part.New("random-generator", "random-generator.html", part.OnLoad(func(data render.Data) error { max := 100 inputMax := data.Get("max") if inputMax, ok := inputMax.(string); ok { max, _ = strconv.Atoi(inputMax) } data.Set("number", rand.Int()%max) return nil }), )
Like pages, you make parts with part.New. The name is more important for parts, since the name is the name of the element in HTML.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.