add meta theme-color

This commit is contained in:
xenia 2023-08-24 05:00:30 -04:00
parent 9fe91ebd2a
commit 2c55a5ac14
2 changed files with 15 additions and 0 deletions

View File

@ -522,3 +522,16 @@ fn test_twitter_cards() {
frag.to_string()
);
}
#[test]
fn test_meta_theme() {
use crate as axohtml;
use crate::{dom::DOMTree, html};
let frag: DOMTree<String> = html!(<meta name="theme-color" content="#ff0000"/>);
assert_eq!(
"<meta content=\"#ff0000\" name=\"theme-color\"/>",
frag.to_string()
);
}

View File

@ -254,6 +254,8 @@ pub enum Metadata {
Robots,
#[strum(to_string = "viewport")]
Viewport,
#[strum(to_string = "theme-color")]
ThemeColor,
// Twitter Social meta card tags -> https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup
#[strum(to_string = "twitter:card")]
TwitterCard,