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

contact-box.html « shortcodes « layouts - github.com/gevhaz/hugo-theme-notrack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4e84b0b2849468ed01e42de75506115762ea6dfa (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
{{ with $.Page.Site.Params.social }}
{{ $socialMap := $.Page.Site.Data.notrack.social }}
{{ $width := default "12em" (.Get "width") }}
{{ $height := default "auto" (.Get "height") }}
{{ $float := default "right" (.Get "float") }}
<div class="contactbox {{ $float }}" style="width: {{ $width }}; height: {{ $height }}">
    <ul>
    {{- $socialArray := slice -}}
    {{ range $website, $user := $.Site.Params.social }}
        {{- $social := $website | lower | index $socialMap | default dict -}}
        {{- $social := dict "user" $user | merge $social -}}
        {{- $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>
    {{ printf "<!-- Icons are from Awesome Font, licenced under SIL OFL 1.1 (https://scripts.sil.org/OFL) -->" | safeHTML }}
</div>
{{ end }}