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>
|
<p>{{ .Content | markdownify }}</p>
|
||||||
</section>
|
</section>
|
||||||
<footer class="entry-footer">
|
<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>
|
</footer>
|
||||||
</article>
|
</article>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<h1>{{ .title | default site.Title | markdownify }}</h1>
|
<h1>{{ .title | default site.Title | markdownify }}</h1>
|
||||||
<span>{{ .subtitle | markdownify }}</span>
|
<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 }}
|
{{- with .buttons }}
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
|
@ -42,4 +42,4 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
{{- end}}
|
{{- end}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<div class="social-icons">
|
<div class="social-icons">
|
||||||
{{- range . }}
|
{{- range .icons }}
|
||||||
<a href="{{ trim .url " " }}" target="_blank" rel="noopener noreferrer me" title="{{ .name | title }}">
|
<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>
|
</a>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue