Skip to content

Commit b22ee02

Browse files
committed
Custom name for meta tags
1 parent ce918b8 commit b22ee02

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Sources/SwiftHtml/Html/Tags/Meta.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,16 @@ public extension Meta {
6767
return self
6868
}
6969

70+
/// set a custom name for the given meta tag
71+
func name(_ value: String) -> Self {
72+
node.upsert(Attribute(key: "name", value: value))
73+
return self
74+
}
75+
7076
/// Specifies a name for the metadata
7177
func name(_ value: Name) -> Self {
72-
node.upsert(Attribute(key: "name", value: value.rawValue))
73-
return self
78+
name(value.rawValue)
7479
}
80+
81+
7582
}

0 commit comments

Comments
 (0)