diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-10-02 13:46:49 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-10-02 13:46:49 +0530 |
| commit | 6dcd4371464b37024e3f4292ae6f7502b725c71c (patch) | |
| tree | 7341b8092aadd6fc75db27d257120da90369280d | |
| parent | 8ff1f10eb734eb075de2da7ebc012a5eb50fbe91 (diff) | |
social-icons: refactor
* use easier impl
| -rw-r--r-- | layouts/partials/home_info.html | 6 | ||||
| -rw-r--r-- | layouts/partials/index_profile.html | 10 | ||||
| -rw-r--r-- | layouts/partials/social_icons.html | 10 |
3 files changed, 11 insertions, 15 deletions
diff --git a/layouts/partials/home_info.html b/layouts/partials/home_info.html index 6f180e8..7feb43a 100644 --- a/layouts/partials/home_info.html +++ b/layouts/partials/home_info.html @@ -7,11 +7,7 @@ <p>{{- .Content | markdownify }}</p> </section> <footer class="entry-footer"> - {{- with $.Site.Params.socialIcons }} - <div class="social-icons"> - {{- partial "social_icons.html" . }} - </div> - {{- end }} + {{- partial "social_icons.html" $.Site.Params.socialIcons -}} </footer> </article> {{- end}}
\ No newline at end of file diff --git a/layouts/partials/index_profile.html b/layouts/partials/index_profile.html index 56e2f47..37db61f 100644 --- a/layouts/partials/index_profile.html +++ b/layouts/partials/index_profile.html @@ -2,12 +2,10 @@ {{- with .Site.Params.profileMode }} <div class="profile_inner"> {{- if .imageUrl}}<img src="{{ .imageUrl}}" alt="{{ .imageTitle | default "profile image" }}" />{{- end}} - <h1>{{ .title | default $.Site.Title }}</h1> - {{- with $.Site.Params.socialIcons }} - <div class="social-icons"> - {{ partial "social_icons.html" . }} - </div> - {{- end }} + <h1>{{- .title | default $.Site.Title -}}</h1> + + {{- partial "social_icons.html" $.Site.Params.socialIcons -}} + {{- with .buttons }} <div class="buttons"> {{- range . -}} diff --git a/layouts/partials/social_icons.html b/layouts/partials/social_icons.html index d48b1e2..1a5d6d2 100644 --- a/layouts/partials/social_icons.html +++ b/layouts/partials/social_icons.html @@ -1,4 +1,6 @@ -{{- range . -}} -<a href="{{ .url }}" target="_blank" rel="noopener noreferrer" - title="{{ .name | humanize }}">{{ partial "svg.html" . }}</a> -{{- end -}}
\ No newline at end of file +<div class="social-icons"> + {{- range . -}} + <a href="{{ .url }}" target="_blank" rel="noopener noreferrer" + title="{{ .name | humanize }}">{{ partial "svg.html" . }}</a> + {{- end -}} +</div>
\ No newline at end of file |
