about summary refs log tree commit diff stats
path: root/components/elements.go
diff options
context:
space:
mode:
authorMarkus Wüstenberg2021-06-08 16:52:57 +0200
committerGitHub2021-06-08 16:52:57 +0200
commit7c0f2e4cbb4da6d7074bd78be9c55d3495c0dad7 (patch)
treeb78fca0bfdde07f730c24b9a23c0b835c0911829 /components/elements.go
parent3e9e00ca0dc6b58e58694d84c97a1d2f2ab4002b (diff)
downloadgomponents-7c0f2e4cbb4da6d7074bd78be9c55d3495c0dad7.tar.lz
gomponents-7c0f2e4cbb4da6d7074bd78be9c55d3495c0dad7.tar.zst
gomponents-7c0f2e4cbb4da6d7074bd78be9c55d3495c0dad7.zip
Add LinkStylesheet and LinkPreload components (#79)
These are often used in the `<head>` part of the HTML.
Diffstat (limited to 'components/elements.go')
-rw-r--r--components/elements.go8
1 files changed, 8 insertions, 0 deletions
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))
+}