feat(socal): add support for custom MastodonPrefix

This commit is contained in:
Dillon 2020-02-08 19:56:42 +08:00
parent 442f5b009a
commit 715cb005c9
3 changed files with 4 additions and 1 deletions

View file

@ -246,6 +246,7 @@ dateFormatToUse = "2006-01-02"
#Googlescholar = "xxxx"
#Researchgate = "xxxx"
#Mastodon = "xxxx"
#MastodonPrefix = "https://mastodon.technology/"
#Thingiverse = "xxxx"
#Devto = "xxxx"
#Gitea = "xxxx"

View file

@ -246,6 +246,7 @@ dateFormatToUse = "2006-01-02"
#Googlescholar = "xxxx"
#Researchgate = "xxxx"
#Mastodon = "xxxx"
#MastodonPrefix = "https://mastodon.technology/"
#Thingiverse = "xxxx"
#Devto = "xxxx"
#Gitea = "xxxx"

View file

@ -269,7 +269,8 @@
</a>
{{- end -}}
{{- with .Site.Params.Social.Mastodon}}
<a href="https://mastodon.social/{{ . }}" rel="me noopener noreffer" target="_blank">
{{ $MastodonPrefix := $.Site.Params.Social.MastodonPrefix | default "https://mastodon.social/" }}
<a href="{{ $MastodonPrefix | safeURL }}{{ . }}" rel="me noopener noreffer" target="_blank">
<i class="fab fa-mastodon fa-fw" title="Mastodon"></i>
</a>
{{- end -}}