Skip to content

Commit d2190c7

Browse files
kendaleivcotes2020
andauthored
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>
1 parent 8e73a91 commit d2190c7

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

_data/contact.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# -
2020
# type: mastodon
2121
# icon: 'fab fa-mastodon' # icons powered by <https://fontawesome.com/>
22-
# url: '' # Fill with your mastodon account page
22+
# url: '' # Fill with your Mastodon account page, rel="me" will be applied for verification
2323
# -
2424
# type: linkedin
2525
# icon: 'fab fa-linkedin' # icons powered by <https://fontawesome.com/>

_includes/sidebar.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,17 @@
8181

8282
{% if url %}
8383
<a href="{{ url }}" aria-label="{{ entry.type }}"
84-
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
84+
{% assign link_types = nil %}
85+
{% unless entry.noblank %}
86+
{% assign link_types = link_types | append: " noopener" %}
87+
target="_blank"
88+
{% endunless %}
89+
90+
{% if entry.type == 'mastodon' %}
91+
{% assign link_types = link_types | append: " me" %}
92+
{% endif %}
93+
94+
{% if link_types %}rel="{{ link_types | lstrip }}"{% endif %}>
8595
<i class="{{ entry.icon }}"></i>
8696
</a>
8797
{% endif %}

0 commit comments

Comments
 (0)