Export social generation to another partial
This commit is contained in:
parent
a8c103d29c
commit
d0530d911b
2 changed files with 12 additions and 15 deletions
|
@ -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 }}
|
||||
|
|
11
layouts/partials/social.html
Normal file
11
layouts/partials/social.html
Normal 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 }}
|
Loading…
Reference in a new issue