Update disqus support, add global site config BookDisqus

This commit is contained in:
Alex Shpak 2020-01-13 17:55:24 +01:00
parent 36a8cf5169
commit ec53e2733f
7 changed files with 20 additions and 6 deletions

View file

@ -168,6 +168,11 @@ disableKinds = ['taxonomy', 'taxonomyTerm']
# (Optional, default true) Enables search function with flexsearch, # (Optional, default true) Enables search function with flexsearch,
# Index is built on fly, therefore it might slowdown your website. # Index is built on fly, therefore it might slowdown your website.
BookSearch = true BookSearch = true
# (Optional, default true) Enables disqus template on pages
# See https://gohugo.io/content-management/comments/#configure-disqus
# Can be overwritten by same param in page frontmatter
BookDisqus = true
``` ```
### Multi-Language Support ### Multi-Language Support
@ -196,8 +201,8 @@ bookHidden = true
# (Optional) Set how many levels of ToC to show. use 'false' to hide ToC completely # (Optional) Set how many levels of ToC to show. use 'false' to hide ToC completely
bookToC = 3 bookToC = 3
# If you have enabled Disqus for the site, you can disable it for specific pages. # (Optional) If you have enabled Disqus for the site, you can disable it for specific pages.
bookDisableComments = true bookDisqus = true
``` ```
### Partials ### Partials

View file

@ -72,3 +72,7 @@ enableGitInfo = true
# Index is built on fly, therefore it might slowdown your website. # Index is built on fly, therefore it might slowdown your website.
BookSearch = true BookSearch = true
# (Optional, default true) Enables disqus template on pages
# See https://gohugo.io/content-management/comments/#configure-disqus
# Can be overwritten by same param in page frontmatter
BookDisqus = true

View file

@ -69,3 +69,8 @@ params:
# (Optional, default true) Enables search function with flexsearch, # (Optional, default true) Enables search function with flexsearch,
# Index is built on fly, therefore it might slowdown your website. # Index is built on fly, therefore it might slowdown your website.
BookSearch: true BookSearch: true
# (Optional, default true) Enables disqus template on pages
# See https://gohugo.io/content-management/comments/#configure-disqus
# Can be overwritten by same param in page frontmatter
BookDisqus: true

View file

@ -1 +1 @@
{"Target":"book.min.68d45956421753cdf6bcfc865ede445c56afc5bcaaebfe02961f44fe77d8f45a.css","MediaType":"text/css","Data":{"Integrity":"sha256-aNRZVkIXU832vPyGXt5EXFavxbyq6/4Clh9E/nfY9Fo="}} {"Target":"book.min.2f0632dc31655f852f191d7c354e584af6f6ca239af70afdd117bbe5950815b2.css","MediaType":"text/css","Data":{"Integrity":"sha256-LwYy3DFlX4UvGR18NU5YSvb2yiOa9wr90Re75ZUIFbI="}}

View file

@ -26,6 +26,6 @@
</div> </div>
{{ if and (not (eq .Site.DisqusShortname "")) (not .Params.bookDisableComments ) }} {{ if (default true (default .Site.Params.BookDisqus .Params.bookDisqus)) }}
{{ template "_internal/disqus.html" . }} {{ template "_internal/disqus.html" . }}
{{ end }} {{ end }}

View file

@ -6,7 +6,7 @@ license = "MIT"
licenselink = "https://github.com/alex-shpak/hugo-book/blob/master/LICENSE" licenselink = "https://github.com/alex-shpak/hugo-book/blob/master/LICENSE"
description = "Hugo documentation theme as simple as plain book" description = "Hugo documentation theme as simple as plain book"
homepage = "https://github.com/alex-shpak/hugo-book" homepage = "https://github.com/alex-shpak/hugo-book"
tags = ["responsive", "clean", "documentation", "docs", "flexbox", "search", "mobile", "multilingual"] tags = ["responsive", "clean", "documentation", "docs", "flexbox", "search", "mobile", "multilingual", "disqus"]
features = [] features = []
min_version = "0.60" min_version = "0.60"