social services icons support #6
This commit is contained in:
parent
dc52fdf1b0
commit
269283077f
27 changed files with 268 additions and 106 deletions
15
layouts/partials/fontawesome.html
Normal file
15
layouts/partials/fontawesome.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<span class="inline-svg" >
|
||||
|
||||
{{ $dict := newScratch }}
|
||||
|
||||
{{ if (eq .custom true) }}
|
||||
{{ $dict.Set "filename" (print "static/fa-icons/" .iconName ".svg") }}
|
||||
{{ else }}
|
||||
{{ $dict.Set "filename" (print "themes/anubis/static/fa-icons/" .iconName ".svg") }}
|
||||
{{ end }}
|
||||
|
||||
{{- $path:="<path" -}}
|
||||
{{- $fill:="<path fill=\"currentColor\"" -}}
|
||||
{{ replace (readFile ($dict.Get "filename")) $path $fill | safeHTML }}
|
||||
|
||||
</span>
|
|
@ -1,6 +1,9 @@
|
|||
<h1 class="site-title">
|
||||
<a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a>
|
||||
</h1>
|
||||
<div class="header-top">
|
||||
<h1 class="site-title">
|
||||
<a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a>
|
||||
</h1>
|
||||
{{ partial "social.html" . }}
|
||||
</div>
|
||||
{{ if .Site.Menus.main }}
|
||||
<nav>
|
||||
{{ $currentPage := . }}
|
||||
|
@ -12,4 +15,4 @@
|
|||
<nav></nav>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "header-extra.html" . }}
|
||||
{{ partial "header-extra.html" . }}
|
||||
|
|
19
layouts/partials/social.html
Normal file
19
layouts/partials/social.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<ul class="social-icons">
|
||||
|
||||
{{ range $.Site.Params.Social }}
|
||||
{{ if and (isset $.Site.Data.social.social_icons .id) (isset . "name") }}
|
||||
{{ $url := index $.Site.Data.social.social_icons .id }}
|
||||
<li>
|
||||
<a href="{{ printf $url .name }}" title="{{ humanize .id }}" rel="me">
|
||||
{{ partial "fontawesome.html" (dict "iconName" .id "custom" false) }}
|
||||
</a>
|
||||
</li>
|
||||
{{ else if (isset . "url") }}
|
||||
<li>
|
||||
<a href="{{ printf .url }}" title="{{ humanize .id }}" rel="me">
|
||||
{{ partial "fontawesome.html" (dict "iconName" .id "custom" true) }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
Loading…
Add table
Add a link
Reference in a new issue