about summary refs log tree commit diff stats
path: root/html/attributes.go
diff options
context:
space:
mode:
authorStéphane Legrand2025-02-06 10:32:15 +0100
committerGitHub2025-02-06 10:32:15 +0100
commit0368e39c137c7f1ab37c84c0787fd6cc9da0c34b (patch)
tree8f6c53ceae4441b8d41929b10eff89173c4a479d /html/attributes.go
parentceb0e8e26d0c0b2e96952176702efa442af55008 (diff)
downloadgomponents-0368e39c137c7f1ab37c84c0787fd6cc9da0c34b.tar.lz
gomponents-0368e39c137c7f1ab37c84c0787fd6cc9da0c34b.tar.zst
gomponents-0368e39c137c7f1ab37c84c0787fd6cc9da0c34b.zip
Add 'download' and 'referrerpolicy' attributes for anchor <a> element (#242)
Hello,

A patch to add
[`download`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download)
and
[`referrerpolicy`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy)
for the anchor `<a>` element.
Diffstat (limited to 'html/attributes.go')
-rw-r--r--html/attributes.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/html/attributes.go b/html/attributes.go
index 6da541d..fb2748b 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -40,6 +40,10 @@ func Disabled() g.Node {
 	return g.Attr("disabled")
 }
 
+func Download(v string) g.Node {
+	return g.Attr("download", v)
+}
+
 func Draggable(v string) g.Node {
 	return g.Attr("draggable", v)
 }
@@ -253,6 +257,10 @@ func Preload(v string) g.Node {
 	return g.Attr("preload", v)
 }
 
+func ReferrerPolicy(v string) g.Node {
+	return g.Attr("referrerpolicy", v)
+}
+
 func Rel(v string) g.Node {
 	return g.Attr("rel", v)
 }