Export social generation to another partial

This commit is contained in:
Gregory Trolliet 2020-04-28 19:13:37 +02:00
parent a8c103d29c
commit d0530d911b
2 changed files with 12 additions and 15 deletions

View File

@ -6,19 +6,5 @@
<h1>{{ .Site.Params.author }}</h1>
<h2>{{ .Site.Params.info }}</h2>
</div>
{{ with .Site.Params.social }}
<ul id="social">
{{ range sort . "weight" }}
<li class="social-element">
{{ if eq .type "tel" }}
<a href="tel:{{ .url }}" rel="me" aria-label="{{ .name }}" title="{{ .name }}">
{{ else }}
<a href="{{ .url }}" rel="me" aria-label="{{ .name }}" title="{{ .name }}">
{{ end }}
<img class="social-icon" src="svg/{{ .icon }}" alt="{{ .name }}" aria-hidden="true">
</a>
</li>
{{ end }}
</ul>
{{ partial "social.html" . }}
</div>
{{ end }}

View File

@ -0,0 +1,11 @@
{{ with .Site.Params.social }}
<ul id="social">
{{ range sort . "weight" }}
<li class="social-element">
<a href="{{ .url | absURL }}" rel="me" aria-label="{{ .name }}" title="{{ .name }}">
<img class="social-icon" src="svg/{{ .icon }}.svg" alt="{{ .name }}" aria-hidden="true">
</a>
</li>
{{ end }}
</ul>
{{ end }}