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,
# Index is built on fly, therefore it might slowdown your website.
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
@ -196,8 +201,8 @@ bookHidden = true
# (Optional) Set how many levels of ToC to show. use 'false' to hide ToC completely
bookToC = 3
# If you have enabled Disqus for the site, you can disable it for specific pages.
bookDisableComments = true
# (Optional) If you have enabled Disqus for the site, you can disable it for specific pages.
bookDisqus = true
```
### Partials

View File

@ -72,3 +72,7 @@ enableGitInfo = true
# Index is built on fly, therefore it might slowdown your website.
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,
# Index is built on fly, therefore it might slowdown your website.
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>
{{ if and (not (eq .Site.DisqusShortname "")) (not .Params.bookDisableComments ) }}
{{ if (default true (default .Site.Params.BookDisqus .Params.bookDisqus)) }}
{{ template "_internal/disqus.html" . }}
{{ end }}

View File

@ -6,7 +6,7 @@ license = "MIT"
licenselink = "https://github.com/alex-shpak/hugo-book/blob/master/LICENSE"
description = "Hugo documentation theme as simple as plain 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 = []
min_version = "0.60"