Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zhaohuabing/hugo-theme-cleanwhite.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhaohuabing <zhaohuabing@gmail.com>2021-12-25 06:37:06 +0300
committerzhaohuabing <zhaohuabing@gmail.com>2021-12-25 06:37:06 +0300
commita74f894f491f3ee7efaf0404d868ec1190ff6b00 (patch)
treed5c82635c23093528d167af6878f28cf8ba9e249
parent1652cb56b47040753ffec8d66cf983f866a5398d (diff)
parent5229f327d8179fc30a18b51a135d4aba1a1568d1 (diff)
Merge branch 'master' of github.com:zhaohuabing/hugo-theme-cleanwhite
-rw-r--r--README.md42
-rw-r--r--exampleSite/config.toml4
-rw-r--r--layouts/partials/comments.html9
3 files changed, 50 insertions, 5 deletions
diff --git a/README.md b/README.md
index 1a278f2..d01ed64 100644
--- a/README.md
+++ b/README.md
@@ -69,16 +69,38 @@ For more information read the official [setup guide](https://gohugo.io/overview/
## Configuration
First, let's take a look at the [config.toml](https://github.com/zhaohuabing/hugo-theme-cleanwhite/blob/master/exampleSite/config.toml). It will be useful to learn how to customize your site. Feel free to play around with the settings.
-### Comments
-The optional comments system is powered by [Disqus](https://disqus.com). If you want to enable comments, create an account in Disqus and write down your shortname.
+### Comment Systems
+
+The following comment systems have been supported by this theme:
+
+#### Giscus
+
+[Giscus](https://giscus.app/) is a comment system powered by GitHub Discussions.
+
+Install [the Giscus app](https://github.com/marketplace/giscus) on your GitHub repo, and set the parameters as below:
+```
+ [params.giscus]
+ data_repo="your GitHub repo"
+ data_repo_id="your repo id"
+ data_category="your category"
+ data_category_id="your category id"
+ data_mapping="pathname"
+ data_reactions_enabled="1"
+ data_emit_metadata="0"
+ data_theme="light"
+ data_lang="en"
+ crossorigin="anonymous"
+```
+
+#### Disqus
+To enable Disqus, create an account in Disqus and write down your shortname.
```toml
disqusShortname = "your-disqus-short-name"
```
-You can disable the comments system by leaving the `disqusShortname` empty.
-### Disqus in China
-Disqus is inaccessible in China. To get it to work, we can set up a proxy with [disqus-php-api](https://github.com/zhaohuabing/disqus-php-api) in a host which sets between the client browser and the Disqus server. The idea is that if Disqus can be reached in the guest network, the blog page will show the original Disqus comments UI, otherwise, it will downgrade and use the proxy to access the Disqus, the UI will be a little different, but the visitors can still write their comments on the page.
+#### Disqus behind a proxy
+If Disqus can't be directly accessed, we can set up a proxy with [disqus-php-api](https://github.com/zhaohuabing/disqus-php-api) in a host which sets between the client browser and the Disqus server. The idea is that if Disqus can be reached in the guest network, the blog page will show the original Disqus comments UI, otherwise, it will downgrade and use the proxy to access the Disqus, the UI will be a little different, but the visitors can still write their comments on the page.
The client side java script has already been integrated to CleanWhite them, but you need to set up a proxy server yourself.
@@ -98,6 +120,16 @@ Set the proxy server address in the site config file of your Hugo project.
```toml
disqus_proxy = "http://yourdisqusproxy.com"
```
+#### Twikoo
+Twikoo is a simple, safe, free comment system based on Tencent CloudBase (tcb).
+
+To deploy Twikoo, please refer to the installation guide on [the twikoo website](https://twikoo.js.org/).
+
+Just enter the twikoo env_id in the configuration file to connect your blog to the deployed Twikoo.
+```
+ twikoo_env_id = "your twikoo env id"
+```
+
### Site Search with Algolia
Follow this [tutorial](https://forestry.io/blog/search-with-algolia-in-hugo/#3-create-your-index-in-algolia) to create your index in Algolia. The index is just the storage of the indexing data of your site in the the cloud . The search page of CleanWhite theme will utilize this indexing data to do the search.
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index b2c05fa..7b17698 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -50,6 +50,10 @@ home = ["HTML", "RSS", "Algolia"]
disqus_proxy = ""
disqus_site = ""
+ # Twikoo comments
+ # Follow https://twikoo.js.org/ to set up your own env_id
+ twikoo_env_id = ""
+
#Enable wechat pay & alipay to allow readers send reward money if they like the articles
reward = true
# reward_guide = "如果这篇文章对你有用,请随意打赏"
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html
index 1bca8a0..a39058d 100644
--- a/layouts/partials/comments.html
+++ b/layouts/partials/comments.html
@@ -30,4 +30,13 @@ var disq = new iDisqus('disqus-comment', {
<!-- disqus 评论框 end -->
<div id="disqus-comment"></div>
{{ template "_internal/disqus.html" . }}
+{{ else if .Site.Params.twikoo_env_id }}
+<div id="twikoo-tcomment"></div>
+<script src="https://cdn.jsdelivr.net/npm/twikoo@1.4.14/dist/twikoo.all.min.js"></script>
+<script>
+ twikoo.init({
+ envId: '{{ .Site.Params.twikoo_env_id }}',
+ el: '#twikoo-tcomment',
+ })
+</script>
{{ end }}