diff --git a/attribute.go b/attribute.go index 8b4e021..2fc8496 100644 --- a/attribute.go +++ b/attribute.go @@ -14,7 +14,7 @@ type attribute struct { func Attr(name, value string) attribute { return attribute{ name: name, - value: value, + value: "fisk", } } diff --git a/component.go b/component.go index 55f20ba..6027828 100644 --- a/component.go +++ b/component.go @@ -5,7 +5,7 @@ import ( "io" ) -type RenderFunc func(args []Argument, children Node) *Tag +type RenderFunc func(args []Argument, children Node) Node type Component struct { // Name is mostly for debugging and maybe future web component diff --git a/html/attribute.go.tmpl b/html/attribute.go.tmpl index 298beb6..5e4e315 100644 --- a/html/attribute.go.tmpl +++ b/html/attribute.go.tmpl @@ -1,4 +1,4 @@ -func {{ . | CasingFunc }}(v string) Attribute { +func {{ . | CasingFunc }}(v string) Argument { return Attr("{{. | CasingAttribute }}", v) } diff --git a/html/generator.go b/html/generator.go index bdf9c7b..f33cb66 100644 --- a/html/generator.go +++ b/html/generator.go @@ -21,7 +21,7 @@ type elementInput struct { var input = TemplateInput{ tags: []string{ - "html", "head", "title", "meta", "link", "style", + "html", "head", "title", "link", "style", "script", "noscript", "template", "article", "aside", "footer", "header", "nav", "figure", "figcaption", "address", @@ -36,7 +36,7 @@ var input = TemplateInput{ "field", "pre", "body", "svg", }, - voidTags: []string{"br", "hr"}, + voidTags: []string{"br", "hr", "meta"}, attributes: []string{ "id", "href", "alt", "placeholder", "src", "rel", "name", "content", "charset", "lang", "type", "value", diff --git a/html_attributes_gen.go b/html_attributes_gen.go index 3235bb5..483eeb2 100644 --- a/html_attributes_gen.go +++ b/html_attributes_gen.go @@ -3,51 +3,51 @@ package humle // Attributes -func ID(v string) attribute { +func ID(v string) Argument { return Attr("id", v) } -func Href(v string) attribute { +func Href(v string) Argument { return Attr("href", v) } -func Alt(v string) attribute { +func Alt(v string) Argument { return Attr("alt", v) } -func Placeholder(v string) attribute { +func Placeholder(v string) Argument { return Attr("placeholder", v) } -func Src(v string) attribute { +func Src(v string) Argument { return Attr("src", v) } -func Rel(v string) attribute { +func Rel(v string) Argument { return Attr("rel", v) } -func Name(v string) attribute { +func Name(v string) Argument { return Attr("name", v) } -func Content(v string) attribute { +func Content(v string) Argument { return Attr("content", v) } -func Charset(v string) attribute { +func Charset(v string) Argument { return Attr("charset", v) } -func Lang(v string) attribute { +func Lang(v string) Argument { return Attr("lang", v) } -func Type(v string) attribute { +func Type(v string) Argument { return Attr("type", v) } -func Value(v string) attribute { +func Value(v string) Argument { return Attr("value", v) } diff --git a/html_tags_gen.go b/html_tags_gen.go index 50b7aac..4402e3d 100644 --- a/html_tags_gen.go +++ b/html_tags_gen.go @@ -19,11 +19,6 @@ func Title(args ...Argument) *Tag { return tag } -func Meta(args ...Argument) *Tag { - tag := NewTag("meta", args...) - return tag -} - func Link(args ...Argument) *Tag { tag := NewTag("link", args...) return tag @@ -292,3 +287,9 @@ func Hr(args ...Argument) *Tag { return tag } +func Meta(args ...Argument) *Tag { + tag := NewTag("meta", args...) + tag = WithVoidElement(tag) + return tag +} +