From 7c0f2e4cbb4da6d7074bd78be9c55d3495c0dad7 Mon Sep 17 00:00:00 2001 From: Markus Wüstenberg Date: Tue, 8 Jun 2021 16:52:57 +0200 Subject: Add LinkStylesheet and LinkPreload components (#79) These are often used in the `` part of the HTML.--- components/elements.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'components/elements.go') diff --git a/components/elements.go b/components/elements.go index f4e347d..c9e1427 100644 --- a/components/elements.go +++ b/components/elements.go @@ -8,3 +8,11 @@ import ( 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)) +} -- cgit 1.4.1