Welcome to mirror list, hosted at ThFree Co, Russian Federation.

social.html « shortcodes « layouts « notrack « themes « exampleSite - github.com/gevhaz/hugo-theme-notrack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fef88ec84541634231cd3a888584641f91726ceb (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
{{ $socialMap := .Site.Data.notrack.social }}

{{ with $.Site.Params.social }}
    <div class="social">
        <ul>
            {{- $socialArray := slice -}}
            {{ range $website, $user := $.Site.Params.social }}
                {{- $social := $website | lower | index $socialMap | default dict -}}
                {{- $social := dict "user" $user | merge $social -}}

                {{- $data := index $socialMap $website -}}

                {{- $socialArray = $socialArray | append $social -}}
            {{ end }}
            {{ range sort $socialArray "weight" -}}
                {{- if .prefix -}}
                <li><a href="{{- .prefix -}}{{ .user }}"><i class="{{- .icon.class -}}"></i>{{ .title }}</a></li>
                {{- else if .template -}}
                <li><a href="{{- printf .template .user -}}"><i class="{{- .icon.class -}}"></i>{{ .title }}</a></li>
                {{- end -}}
            {{- end -}}
        </ul>
    </div>
{{ end }}

{{ printf "<!-- Icons are from Awesome Font, licenced under SIL OFL 1.1 (https://scripts.sil.org/OFL) -->" | safeHTML }}