Use .Param for TOC and comments

Enable/disable "TOC" and "comments" partials for all site or specific posts.
See: https://gohugo.io/functions/param/
This commit is contained in:
vimux 2018-05-27 00:02:06 +03:00
parent 0f53632b07
commit b099c5e941
No known key found for this signature in database
GPG key ID: 5A34FDC4EE832E34
2 changed files with 2 additions and 2 deletions

View file

@ -1,4 +1,4 @@
{{ if and .Site.DisqusShortname (not (or .Site.Params.comments .Params.comments)) }} {{ if and (.Site.DisqusShortname) (.Param "comments") }}
<section class="comments block"> <section class="comments block">
{{ template "_internal/disqus.html" . }} {{ template "_internal/disqus.html" . }}
</section> </section>

View file

@ -1,4 +1,4 @@
{{ if .Params.toc }} {{ if .Param "toc" }}
<details class="post__toc toc" {{ if .Params.tocOpen }}open{{ end }}> <details class="post__toc toc" {{ if .Params.tocOpen }}open{{ end }}>
<summary class="toc__title">{{- T "post_toc" -}}</summary> <summary class="toc__title">{{- T "post_toc" -}}</summary>
{{ .TableOfContents }} {{ .TableOfContents }}