From 2427d9547fa31d1904dfa35c0079af6b8adb761c Mon Sep 17 00:00:00 2001 From: Zoey Date: Tue, 8 Nov 2022 10:36:31 -0800 Subject: [PATCH] Add hacky workaround for Mastodon link verification --- src/builder.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/builder.rs b/src/builder.rs index 30c1f79..2c58a4d 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -155,9 +155,14 @@ impl<'a> SiteBuilder<'a> { }), element!("a", |el| { if let Some(href) = el.get_attribute("href") { + let me = href == "https://mas.to/@zyl"; if let Ok(href) = Url::parse(&href) { if href.host().is_some() { - el.set_attribute("rel", "noopener noreferrer")?; + let mut rel = String::from("noopener noreferrer"); + if me { + rel.push_str(" me"); + } + el.set_attribute("rel", &rel)?; el.set_attribute("target", "_blank")?; } }