Skip to content

Commit

Permalink
Merge pull request #506 from imaegoo/twikoo
Browse files Browse the repository at this point in the history
Support Twikoo comment system.
  • Loading branch information
tufu9441 authored Feb 19, 2021
2 parents 3dcf514 + ad2053e commit 44d7436
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ 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, 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.
Expand Down Expand Up @@ -168,6 +173,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
Expand Down
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ 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, 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.
Expand Down
13 changes: 12 additions & 1 deletion layout/_partial/comments.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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}'
})

0 comments on commit 44d7436

Please sign in to comment.