all repos — gomponents @ 7c0f2e4cbb4da6d7074bd78be9c55d3495c0dad7

HTML components in pure Go

Add LinkStylesheet and LinkPreload components (#79) These are often used in the `<head>` part of the HTML.

Markus Wüstenberg
commit

7c0f2e4cbb4da6d7074bd78be9c55d3495c0dad7

parent

3e9e00ca0dc6b58e58694d84c97a1d2f2ab4002b

1 file changed, 8 insertions(+), 0 deletions(-)

changed files
M components/elements.gocomponents/elements.go
@@ -8,3 +8,11 @@
func InputHidden(name, value string, children ...g.Node) g.Node { return Input(Type("hidden"), Name(name), Value(value), g.Group(children)) } + +func LinkStylesheet(href string, children ...g.Node) g.Node { + return Link(Rel("stylesheet"), Href(href), g.Group(children)) +} + +func LinkPreload(href, as string, children ...g.Node) g.Node { + return Link(Rel("preload"), Href(href), As(as), g.Group(children)) +}