refactor: move document head includes out of via configuration into their own append funcs; update examples

This commit is contained in:
Joao Goncalves
2025-11-09 03:17:03 -01:00
parent 5c80a934e9
commit 9f9e4eb568
7 changed files with 72 additions and 90 deletions

View File

@@ -8,12 +8,7 @@ import (
func main() {
v := via.New()
v.Config(via.Options{
DocumentTitle: "Via",
DocumentHeadIncludes: []h.H{
h.Link(h.Rel("stylesheet"), h.Href("https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css")),
},
})
v.AppendToHead(h.Link(h.Rel("stylesheet"), h.Href("https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css")))
v.Page("/", func(c *via.Context) {
c.View(func() h.H {