1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-06-26 16:13:45 +02:00

layouts/_default/single.html: Adjust Disqus logic

Bring the Disqus comments inside the <article> tag. The article has
a sizeable bottom margin seprating it from the blog footer, and if
Disqus comments are active they appear after this margin, and this
looks ugly.

Semantically, I think the comments should actually be inside the
article tag anyways (since they are directly related), as well as
further wrapped in article tags, but we don't control the code that
Disqus injects so we'll have to make do with this.

See: https://www.w3.org/TR/html5/sections.html#the-article-element
This commit is contained in:
Alan Orth 2017-01-07 11:22:45 +02:00
parent af39372a24
commit 1f6cc0cf42
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -19,14 +19,22 @@
{{ end }}
</ul>
{{ end }}
{{ if or (not .Site.Params.sharingicons.hide) (.Site.DisqusShortname) }}
<hr>
<footer>
{{ if not .Site.Params.sharingicons.hide }}
{{ partial "sharing-icons.html" . }}
{{ end }}
</article> <!-- /.blog-post -->
{{ if and (.Site.DisqusShortname) (ne .Params.comments false) }}
{{ partial "disqus.html" . }}
{{ end }}
{{ if and (.Site.DisqusShortname) (ne .Params.comments false) }}
{{ partial "disqus.html" . }}
{{ end }}
</footer>
{{ end }}
</article> <!-- /.blog-post -->
{{ end }}