mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-07-06 13:59:12 +02:00
25 lines
818 B
HTML
25 lines
818 B
HTML
|
{{ $name := .Get "name" }}
|
||
|
{{ if not $name }} {{ errorf "Sociallink shortcode: name param not found" }} {{ end }}
|
||
|
{{ $url := false }}
|
||
|
{{ with .Site.Author.links }}
|
||
|
{{ range $links := . }}
|
||
|
{{ range $s_name, $s_url := $links }}
|
||
|
{{ if eq $s_name $name }} {{ $url = $s_url }} {{ end }}
|
||
|
{{ end }}
|
||
|
{{ if $url }} {{ break }} {{ end }}
|
||
|
{{ end }}
|
||
|
{{ end }}
|
||
|
{{ if $url }}
|
||
|
<a
|
||
|
href="{{ $url | safeURL }}"
|
||
|
target="_blank"
|
||
|
aria-label="{{ $name | title }}"
|
||
|
rel="me noopener noreferrer"
|
||
|
>
|
||
|
{{ if .Get "showIcon" }}<span class="inline-block" style="vertical-align:text-top;" >{{ partial "icon.html" $name }} </span>{{ end }}
|
||
|
{{ .Inner | markdownify }}
|
||
|
</a>
|
||
|
{{ else }}
|
||
|
{{ errorf "Sociallink shortcode: link not found" $name }}
|
||
|
{{ end }}
|