From d2190c726f61c8c9732b88b4aecf699dc8bc7deb Mon Sep 17 00:00:00 2001 From: Ken Dale Date: Sat, 24 Dec 2022 14:31:11 -0500 Subject: [PATCH] feat: add `rel="me"` to Mastodon sidebar contact links for verification (#807) This will enable verification with Mastodon by including the `rel="me"` attribute. https://docs.joinmastodon.org/user/profile/#verification Co-authored-by: Cotes Chung <11371340+cotes2020@users.noreply.github.com> --- _data/contact.yml | 2 +- _includes/sidebar.html | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/_data/contact.yml b/_data/contact.yml index 05da2f2..a94e555 100644 --- a/_data/contact.yml +++ b/_data/contact.yml @@ -19,7 +19,7 @@ # - # type: mastodon # icon: 'fab fa-mastodon' # icons powered by -# url: '' # Fill with your mastodon account page +# url: '' # Fill with your Mastodon account page, rel="me" will be applied for verification # - # type: linkedin # icon: 'fab fa-linkedin' # icons powered by diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 93c6749..c32efb3 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -81,7 +81,17 @@ {% if url %} + {% assign link_types = nil %} + {% unless entry.noblank %} + {% assign link_types = link_types | append: " noopener" %} + target="_blank" + {% endunless %} + + {% if entry.type == 'mastodon' %} + {% assign link_types = link_types | append: " me" %} + {% endif %} + + {% if link_types %}rel="{{ link_types | lstrip }}"{% endif %}> {% endif %}