change the way svg icon is get
use data instead of if else in partial, this makes iterating and display all the icons possible
This commit is contained in:
parent
8fb2f38f43
commit
8a0915bb81
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
<p>{{ .Content | markdownify }}</p>
|
||||
</section>
|
||||
<footer class="entry-footer">
|
||||
{{ partial "social_icons.html" site.Params.socialIcons }}
|
||||
{{ partial "social_icons.html" (dict "icons" site.Params.socialIcons "svg" $.Site.Data.svg) }}
|
||||
</footer>
|
||||
</article>
|
||||
{{- end -}}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
{{- end }}
|
||||
<h1>{{ .title | default site.Title | markdownify }}</h1>
|
||||
<span>{{ .subtitle | markdownify }}</span>
|
||||
{{- partial "social_icons.html" site.Params.socialIcons -}}
|
||||
{{- partial "social_icons.html" (dict "icons" site.Params.socialIcons "svg" $.Site.Data.svg) -}}
|
||||
|
||||
{{- with .buttons }}
|
||||
<div class="buttons">
|
||||
|
@ -42,4 +42,4 @@
|
|||
{{- end }}
|
||||
</div>
|
||||
{{- end}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<div class="social-icons">
|
||||
{{- range . }}
|
||||
{{- range .icons }}
|
||||
<a href="{{ trim .url " " }}" target="_blank" rel="noopener noreferrer me" title="{{ .name | title }}">
|
||||
{{ partial "svg.html" . }}
|
||||
{{- $icon_name := ( trim .name " " | lower )}}
|
||||
{{ safeHTML (index $.svg $icon_name | default $.svg.default) }}
|
||||
</a>
|
||||
{{- end }}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue