1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-11-16 01:07:03 +01:00

layouts/_default/single.html: Simplify sharing icon logic

Allowing users to select specific icons they want to show makes the
configuration and logic a bit tricky. A user brought up the case of
disabling sharing icons on certain pages/posts, and it was actaully
not possible without adding lots of extra logic, not to mention the
pain of having to test all possible configurations.

Instead, it is much simpler to just allow sharing icons to be either
on or off as desired in the site config or page/post frontmatter:

  sharingicons = false

Otherwise, sharing icons default to being enabled, as this is most
in line with what would be expected on a "blog".
This commit is contained in:
Alan Orth 2017-01-21 19:16:57 +02:00
parent 8ab05ae625
commit 2459ad9567
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -66,11 +66,11 @@
</ul> </ul>
{{ end }} {{ end }}
{{ if or (not .Site.Params.sharingicons.hide) (.Site.DisqusShortname) }} {{ if or (ne ($.Param "sharingicons") false) (.Site.DisqusShortname) }}
<hr> <hr>
<footer> <footer>
{{ if not .Site.Params.sharingicons.hide }} {{ if (ne ($.Param "sharingicons") false) }}
{{ partial "sharing-icons.html" . }} {{ partial "sharing-icons.html" . }}
{{ end }} {{ end }}