feat: improve real-time chart example; add small refinements to via core files

This commit is contained in:
Joao Goncalves
2025-11-07 00:44:48 -01:00
parent c167f0c74f
commit 798f024743
7 changed files with 63 additions and 20 deletions

8
h/h.go
View File

@@ -11,6 +11,7 @@ package h
import (
"io"
g "maragu.dev/gomponents"
gc "maragu.dev/gomponents/components"
)
@@ -50,6 +51,13 @@ func Attr(name string, value ...string) H {
return g.Attr(name, value...)
}
func If(condition bool, n H) H {
if condition {
return n
}
return nil
}
// HTML5Props defines properties for HTML5 pages. Title is set always set, Description
// and Language elements only if the strings are non-empty.
type HTML5Props struct {