Skip to content

Commit

Permalink
Custom name for meta tags
Browse files Browse the repository at this point in the history
  • Loading branch information
tib committed Nov 24, 2021
1 parent ce918b8 commit b22ee02
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Sources/SwiftHtml/Html/Tags/Meta.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@ public extension Meta {
return self
}

/// set a custom name for the given meta tag
func name(_ value: String) -> Self {
node.upsert(Attribute(key: "name", value: value))
return self
}

/// Specifies a name for the metadata
func name(_ value: Name) -> Self {
node.upsert(Attribute(key: "name", value: value.rawValue))
return self
name(value.rawValue)
}


}

0 comments on commit b22ee02

Please sign in to comment.