From f009c76bfbd4305f143dc46251926c9803cbd74e Mon Sep 17 00:00:00 2001 From: iMaeGoo Date: Thu, 18 Feb 2021 16:12:15 +0800 Subject: [PATCH 1/2] Support Twikoo comment system. --- README.md | 5 +++++ _config.yml | 4 ++++ layout/_partial/comments.pug | 13 ++++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1735c3c75..19f5f5ff5 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,10 @@ utterances: ## See: https://utteranc.es repo: ## The repository utterances will connect to, e.g. tufu9441/comments identifier: title ## The mapping between blog posts and GitHub issues. theme: github-light ## Choose an Utterances theme which matches your blog. +twikoo: ## See: https://twikoo.js.org + enable: false ## If you want to use twikoo comment system, please set the value to true. + envId: ## Tencent CloudBase envId + region: ## Tencent CloudBase region google_search: true ## Use Google search, true/false. baidu_search: false ## Use Baidu search, true/false. @@ -168,6 +172,7 @@ version: 1.0.0 - valine - [Valine](https://valine.js.org) comment system - minivaline - [MiniValine](https://github.com/MiniValine/MiniValine) comment system - utterances - [Utterances](https://utteranc.es) comment system +- twikoo - [Twikoo](https://twikoo.js.org) comment system - google_search - Default search engine - baidu_search - Search engine for users in China - swiftype - [Swiftype Search](https://swiftype.com) key diff --git a/_config.yml b/_config.yml index 78d1900bb..f7d35d78c 100644 --- a/_config.yml +++ b/_config.yml @@ -44,6 +44,10 @@ utterances: ## See: https://utteranc.es repo: ## The repository utterances will connect to, e.g. tufu9441/comments identifier: title ## The mapping between blog posts and GitHub issues. theme: github-light ## Choose an Utterances theme which matches your blog. +twikoo: ## See: https://twikoo.js.org + enable: false ## If you want to use twikoo comment system, please set the value to true. + envId: ## Tencent CloudBase envId + region: ## Tencent CloudBase region google_search: true ## Use Google search, true/false. baidu_search: false ## Use Baidu search, true/false. diff --git a/layout/_partial/comments.pug b/layout/_partial/comments.pug index ed407aac4..76f0ac927 100644 --- a/layout/_partial/comments.pug +++ b/layout/_partial/comments.pug @@ -144,4 +144,15 @@ if theme.minivaline.enable == true }) if theme.utterances.enable == true - script(src='https://utteranc.es/client.js', repo=theme.utterances.repo, issue-term=theme.utterances.identifier, theme=theme.utterances.theme, crossorigin='anonymous', async) \ No newline at end of file + script(src='https://utteranc.es/client.js', repo=theme.utterances.repo, issue-term=theme.utterances.identifier, theme=theme.utterances.theme, crossorigin='anonymous', async) + +if theme.twikoo.enable == true + #tcomment + script(src='https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js') + script. + twikoo.init({ + envId: '#{theme.twikoo.envId}', + el: '#tcomment', + region: '#{theme.twikoo.region}', + path: '#{theme.twikoo.path}' + }) From ad2053ef8ae68e6a52369495e7b0c0402d4ce182 Mon Sep 17 00:00:00 2001 From: iMaeGoo Date: Fri, 19 Feb 2021 08:50:19 +0800 Subject: [PATCH 2/2] Support Twikoo comment system. --- README.md | 3 ++- _config.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 19f5f5ff5..031a951bf 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,8 @@ utterances: ## See: https://utteranc.es twikoo: ## See: https://twikoo.js.org enable: false ## If you want to use twikoo comment system, please set the value to true. envId: ## Tencent CloudBase envId - region: ## Tencent CloudBase region + region: ## Tencent CloudBase region, e.g. ap-shanghai + path: ## Article path, e.g. window.location.pathname google_search: true ## Use Google search, true/false. baidu_search: false ## Use Baidu search, true/false. diff --git a/_config.yml b/_config.yml index f7d35d78c..5ebde3746 100644 --- a/_config.yml +++ b/_config.yml @@ -47,7 +47,8 @@ utterances: ## See: https://utteranc.es twikoo: ## See: https://twikoo.js.org enable: false ## If you want to use twikoo comment system, please set the value to true. envId: ## Tencent CloudBase envId - region: ## Tencent CloudBase region + region: ## Tencent CloudBase region, e.g. ap-shanghai + path: ## Article path, e.g. window.location.pathname google_search: true ## Use Google search, true/false. baidu_search: false ## Use Baidu search, true/false.