* Add Prettier set-up (no formatting in this commit). * Manual fixes for Prettier issues. * Run Prettier fix on non-markdown files. * Incorporate Prettier PR feedback - update commands, re-apply new yaml styles, add editor config. * Remove deprecated config item. * Add dependency on prettier-plugin-go-template. * reconcile changed file with prettier formatting. * Add git blame ignore revs file to include Prettier formatting commit. * Fix format issue with merge conflict.
23 lines
961 B
HTML
23 lines
961 B
HTML
<!--
|
|
Render a list of social media icons based on a mapping of accounts to handles.
|
|
e.g. { "social": { "github": "chrsmith", "twitter": "aChrisSmith" } }
|
|
-->
|
|
{{ if .social }}
|
|
{{ $socialIdentities := .social }}
|
|
{{ $platforms := slice "github" "linkedin" "twitter" }}
|
|
{{ $platformUrlPrefixes := slice "https://github.com" "https://www.linkedin.com/in" "https://twitter.com" }}
|
|
|
|
|
|
<ul class="list-none p-0 inline-flex items-center">
|
|
{{ range $idx, $platform := $platforms }}
|
|
{{ if (index $socialIdentities $platform) }}
|
|
<li class="{{ if lt $idx (sub (len $platforms) 1) }}mr-3{{ end }}">
|
|
<a data-track="{{ $platform | urlize }}" href="{{ index $platformUrlPrefixes $idx }}/{{ index $socialIdentities $platform }}">
|
|
<i class="fab fa-{{ $platform }}"></i>
|
|
</a>
|
|
</li>
|
|
{{ end }}
|
|
{{ end }}
|
|
</ul>
|
|
{{ end }}
|