blob: 4b11574453f1afe5ae2c9eac7a9db16d5b8dd6ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
<!-- Reduce repetition... -->
{{ $centralized := $.Site.Params.Social.Centralized }}
{{ $decentralized := $.Site.Params.Social.Decentralized }}
<section class="social">
{{ range .Site.Data.social }}
{{ $currentEntry := .entry }}
{{ $currentLabel := .label }}
{{ $currentBase := .base }}
{{ $currentIcon := .icon.id }}
{{ if not .decentralized }}
{{ with (index $centralized $currentEntry) }}
{{ $url := printf "%s%s" $currentBase (index . 0) }}
{{ $label := $currentLabel }}
{{ with (index . 1) }}
{{ $label = . }}
{{ end }}
<a class="btn" href="{{ $url }}" rel="me nofollow" title="{{ $label }}">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<use xlink:href="#{{ $currentIcon }}"/>
</svg>
<p>{{ $label }}</p>
</a>
{{ end }}
{{ else }}
{{ if (index $decentralized $currentEntry) }}
{{ range (index $decentralized $currentEntry) }}
<a class="btn" href="{{ index . 0 }}" rel="me nofollow" title="{{ printf "%s (%s)" (index . 1) $currentLabel }}">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<use xlink:href="#{{ $currentIcon }}"/>
</svg>
<p>{{ index . 1 | truncate 15 }}</p>
</a>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</section>
|