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>
This commit is contained in:
Ken Dale 2022-12-24 14:31:11 -05:00 committed by GitHub
parent 8e73a91d25
commit d2190c726f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -19,7 +19,7 @@
# -
# type: mastodon
# icon: 'fab fa-mastodon' # icons powered by <https://fontawesome.com/>
# 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 <https://fontawesome.com/>

View file

@ -81,7 +81,17 @@
{% if url %}
<a href="{{ url }}" aria-label="{{ entry.type }}"
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
{% 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 %}>
<i class="{{ entry.icon }}"></i>
</a>
{% endif %}