mirror of
https://github.com/zyllian/zyllian.github.io.git
synced 2025-01-18 11:47:01 -08:00
Add hacky workaround for Mastodon link verification
This commit is contained in:
parent
c7a2d7028f
commit
2427d9547f
1 changed files with 6 additions and 1 deletions
|
@ -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")?;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue