-
Notifications
You must be signed in to change notification settings - Fork 66
/
social.html
executable file
·25 lines (23 loc) · 1.18 KB
/
social.html
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
<nav class="ui top secondary menu bar">
<div class="item">
<i class="inverted big link bullseye icon dream-flip-toggle" title="{{ i18n `flip` }}"></i>
</div>
{{ range $index, $val := $.Site.Social }}
{{ $.Scratch.Set $index $val }}
{{ end }}
{{/*slices to loop over*/}}
{{ $sites := slice "GitHub" "Email" "Twitter" "YouTube" "Medium" "LinkedIn" "Stack Overflow" "CodePen" "Reddit" }}
{{ $links := slice "https://github.com/" "mailto:" "https://twitter.com/" "https://youtube.com/user/" "https://medium.com/@" "https://www.linkedin.com/in/" "https://www.stackoverflow.com/users/" "https://codepen.io/" "https://reddit.com/user/" }}
{{ $icons := slice "github" "mail" "twitter" "youtube play" "medium" "linkedin" "stack overflow" "codepen" "reddit" }}
{{/*Generate HTML for each site*/}}
{{ range $index, $val := $sites }}
{{ $var := replace $val " " "" | lower }}
{{ with ($.Scratch.Get $var) }}
<div class="item">
<a href="{{ index $links $index }}{{ $.Scratch.Get $var }}" rel="me" {{ if ne $var "mail" }}target=" _blank"{{ end }}>
<i id="ico" class="inverted big link {{ index $icons $index }} icon" title="{{ $val }}"></i>
</a>
</div>
{{ end }}
{{ end }}
</nav>