-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add enum
for MetaTag
properties and names outlined in #348.
#373
Conversation
} | ||
|
||
/// Metadata properties for social media sharing. | ||
public enum Property: String, Sendable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The distinction between Name
and Property
seems like a bagatelle, and means folks need to select the correct initializer in order to see code completion for the things they care about. Could we merge all these into a single enum, then use a computed property to return the key
string based on a switch
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent idea! Will revise 🙌🏼
/// Metadata names for social media cards. | ||
public enum Name: String, Sendable { | ||
/// The image to display in Twitter cards. | ||
case twitterImage = "twitter:image" | ||
/// The title to display in Twitter cards. | ||
case twitterTitle = "twitter:title" | ||
/// The domain to display in Twitter cards. | ||
case twitterDomain = "twitter:domain" | ||
/// The type of Twitter card to use. | ||
case twitterCard = "twitter:card" | ||
/// Whether to disable Twitter tracking. | ||
case twitterDoNotTrack = "twitter:dnt" | ||
/// The description to display in Twitter cards. | ||
case twitterDescription = "twitter:description" | ||
/// The software used to generate the document. | ||
case generator | ||
/// The viewport configuration for responsive web design. | ||
case viewport | ||
|
||
/// The meta attribute key. | ||
var key: String { "name" } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the introduction of some more public-facing enums and decided to create #380. I'd like to have a conversation there to decide whether or not this is something we want to do instead
Perfect – thank you! |
No description provided.