all repos — gomponents @ 3b7dceab897709fe8243c605adea90ee771c49ff

HTML components in pure Go

Streamline HTML element API (#66) There were a lot of elements previously, like `Em`, `H1`, and a lot more, that took a string as the first argument previously. This was weird when you wanted to mix elements to output html like `<strong><em>…</em></strong>` or `<h1>Something <em>something</em> something</h1>`. gomponents is not an HTML validator, so I want people to be able to use elements however they please, also without text content. This also means that all elements now have the same API.

Markus Wüstenberg
commit

3b7dceab897709fe8243c605adea90ee771c49ff

parent

5d2f0f1b87aff69edf5b3a993afbb1ae2db946d0

1 file changed, 1 insertion(+), 1 deletion(-)

changed files
M components/documents.gocomponents/documents.go
@@ -23,7 +23,7 @@ HTML(g.If(p.Language != "", Lang(p.Language)),
Head( Meta(Charset("utf-8")), Meta(Name("viewport"), Content("width=device-width, initial-scale=1")), - TitleEl(p.Title), + TitleEl(g.Text(p.Title)), g.If(p.Description != "", Meta(Name("description"), Content(p.Description))), g.Group(p.Head), ),