chore: add rel="me" attribute to Mastodon navbar icon (#243)

* Add rel="me" attribute to Mastodon navbar icon

The rel="me" attribute enables verified links on the linked Mastodon profile

* Set $rel based on icon name
This commit is contained in:
verbumfeit 2024-01-08 19:25:54 +01:00 committed by GitHub
parent 10f1d85ab4
commit f5e4283961
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,8 @@
{{/* Display icon menu item */}}
{{- if .Params.icon -}}
<a class="p-2 text-current" {{ if $external }}target="_blank" rel="noreferer"{{ end }} href="{{ $link }}" title="{{ or (T .Identifier) .Name | safeHTML }}">
{{- $rel := cond (eq .Params.icon "mastodon") "noreferer me" "noreferer" }}
<a class="p-2 text-current" {{ if $external }}target="_blank" rel="{{ $rel }}"{{ end }} href="{{ $link }}" title="{{ or (T .Identifier) .Name | safeHTML }}">
{{- partial "utils/icon.html" (dict "name" .Params.icon "attributes" "height=24") -}}
<span class="sr-only">{{ or (T .Identifier) .Name | safeHTML }}</span>
</a>