Skip to content
Clone
f323ba1
29 lines 744 B Rust
use crate::parse::{EmbedRule, Platform};
use crate::Category;
pub struct Mastodon;
impl Platform for Mastodon {
fn id(&self) -> &'static str {
"mastodon"
}
fn name(&self) -> &'static str {
"Mastodon"
}
fn category(&self) -> Category {
Category::Social
}
fn domains(&self) -> &'static [&'static str] {
&["mastodon.social", "mastodon.online", "mstdn.social", "mastodon.world", "pawoo.net", "fosstodon.org"]
}
fn embed_rule(&self) -> Option<EmbedRule> {
// 嘟文卡片:非 16:9,按卡片高度给固定值,避免黑底空框。
Some(EmbedRule::frame("https://{host}{path}/embed").fixed_height(420))
}
}
pub static PLATFORM: Mastodon = Mastodon;