all repos — gomponents @ c366cfc3574daf7b31e4fa68790c29fc72f7b74b

HTML components in pure Go

Add support for additional HTML attributes in HTML5 template (#238) This PR updates the HTML5 function to accept and render additional HTML attributes. An additional test case to validate this enhancement has been added as well.

Winni Neessen
commit

c366cfc3574daf7b31e4fa68790c29fc72f7b74b

parent

d4a299fe07de5c7b4e6f1657f9474043d6074d8a

1 file changed, 2 insertions(+), 1 deletion(-)

changed files
M components/components.gocomponents/components.go
@@ -18,12 +18,13 @@ Description string
Language string Head []g.Node Body []g.Node + HTMLAttrs []g.Node } // HTML5 document template. func HTML5(p HTML5Props) g.Node { return Doctype( - HTML(g.If(p.Language != "", Lang(p.Language)), + HTML(g.If(p.Language != "", Lang(p.Language)), g.Group(p.HTMLAttrs), Head( Meta(Charset("utf-8")), Meta(Name("viewport"), Content("width=device-width, initial-scale=1")),