diff --git a/typed-html/src/elements.rs b/typed-html/src/elements.rs index a955905..f8377df 100644 --- a/typed-html/src/elements.rs +++ b/typed-html/src/elements.rs @@ -78,6 +78,8 @@ declare_elements! { content: String, http_equiv: HTTPEquiv, name: Metadata, + // non standard, uses https://en.wikipedia.org/wiki/RDFa + property: MetadataProperties, } in [MetadataContent]; style { type: Mime, @@ -459,3 +461,16 @@ fn test_data_attributes() { assert_eq!("
Boo!
", frag.to_string()); } +#[test] +fn test_meta_tags() { + use crate as axohtml; + use crate::{dom::DOMTree, html}; + + let frag: DOMTree = html!( + ); + + assert_eq!( + "", + frag.to_string() + ); +} diff --git a/typed-html/src/types/mod.rs b/typed-html/src/types/mod.rs index 0fb5881..f2d81bc 100644 --- a/typed-html/src/types/mod.rs +++ b/typed-html/src/types/mod.rs @@ -254,6 +254,32 @@ pub enum Metadata { Viewport, } +#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)] +pub enum MetadataProperties { + #[strum(to_string = "og:title")] + Title, + #[strum(to_string = "og:type")] + Type, + #[strum(to_string = "og:image")] + Image, + #[strum(to_string = "og:url")] + Homepage, + #[strum(to_string = "og:audio")] + Audio, + #[strum(to_string = "og:description")] + Description, + #[strum(to_string = "og:determiner")] + Determiner, + #[strum(to_string = "og:locale")] + Locale, + #[strum(to_string = "og:site_name")] + ParentSiteName, + #[strum(to_string = "og:video")] + Video, + #[strum(to_string = "og:locale:alternate")] + ExtraLocales, +} + #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)] pub enum OnOff { #[strum(to_string = "on")]