LiveReload

This commit is contained in:
Jeff Winkler
2025-11-08 13:05:23 -05:00
parent c1ddb6441e
commit 3b658ed7d0
7 changed files with 185 additions and 1 deletions

5
via.go
View File

@@ -75,6 +75,9 @@ func (v *V) Config(cfg Options) {
if cfg.LogLvl != v.cfg.LogLvl {
v.cfg.LogLvl = cfg.LogLvl
}
if cfg.DocumentTitle != "" {
v.cfg.DocumentTitle = cfg.DocumentTitle
}
if cfg.DocumentHeadIncludes != nil {
v.cfg.DocumentHeadIncludes = cfg.DocumentHeadIncludes
}
@@ -142,6 +145,8 @@ func (v *V) registerCtx(id string, c *Context) {
// }
func (v *V) getCtx(id string) (*Context, error) {
v.contextRegistryMutex.RLock()
defer v.contextRegistryMutex.RUnlock()
if c, ok := v.contextRegistry[id]; ok {
return c, nil
}