package test import "github.com/doors-dev/doors" type NoBeam struct { } func (f NoBeam) setBeam(_ doors.SourceBeam[Path]) {} type Path struct { Vh bool `path:""` Vs bool `path:"/s"` Vp bool `path:"/s/:P"` P string } type Fragment interface { setBeam(b doors.SourceBeam[Path]) doors.Fragment } type Page struct { F Fragment H func(doors.SourceBeam[Path]) templ.Component Header string } func (p *Page) h1() string { return p.Header } func (p *Page) head(b doors.SourceBeam[Path]) templ.Component { if p.H == nil { return templ.NopComponent } return p.H(b) } templ (p *Page) content(b doors.SourceBeam[Path]) { if p.F != nil { {{ p.F.setBeam(b) }} @doors.F(p.F) } } templ (p *Page) Render(b doors.SourceBeam[Path]) { @Document(p, b) }