blob: f4294da6716dc2808a2acb93360ecdebde9fa866 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
## Enable or disable comment
Now, this theme support these comment service:
- LiveRe
- Gitalk
- Disqus
- Twikoo
- Waline
- Utterances
### Customizing existing comment service
### Enabling
#### Gitalk
Edit your `config.toml` in the hugo website's root directory.
Add the following line to the section `[params]`
```toml
enableGitalk = true
```
Then add following lines behind:
```toml
[params.gitalk]
owner = "user"
repo = "repo name"
client_id = "your client id"
client_secret = "your client secret"
```
(Modify to suit your condition.)
Notice: Gitalk will not shown in offline preview server.(Launched by `hugo server`)
#### Disqus
To add a disqus comment service, please add a line to `config.toml` in the root directory, under `[params]`:
```toml
[params]
disqusShortname = "Your disqus short name."
```
Thanks for [nicholaskajoh](https://github.com/AmazingRise/hugo-theme-diary/issues/51) and [jenlky](https://github.com/AmazingRise/hugo-theme-diary/issues/42)'s feedback.
#### LiveRe!
Edit your `config.toml` in the hugo website's root directory.
Add the following line to the section `[params]`
```toml
livereId = "xxxx"
```
"xxxx" stands for the value of `data-uid` in your LiveRe HTML code.
#### Twikoo
Edit your `config.toml` in the hugo website's root directory.
Add the following line to the section `[params]`
```toml
enableTwikoo = true
twikooEnvId = "twikoo-YourEnvId"
```
Replace YourEnvId with your actual environment id.
If your Tencent Cloud Environment is deployed in Guangzhou server, don't forget to add this:
```toml
twikooRegion = "ap-guangzhou"
```
#### Waline
Edit your `config.toml` in the hugo website's root directory.
Add the following line to the section `[params]`
```toml
walineServer = "https://yourappaddress.vercel.app"
```
`walineServer` is corresponding to `serverURL`.
#### Utterances
Edit your `config.toml` in the hugo website's root directory.
Add the following line to the section `[params]`
```toml
enableUtterances = true
```
And add a new section named `params.utterances`, like this:
```toml
[params.utterances]
repo="your repo"
term="[ENTER TERM HERE]"
label="your label"
theme="github-light"
```
#### Other
To add other services, you can edit `./layouts/partials/comment.html` and `./layouts/partials/head.html` by yourself.
And you can also open an issue, reminding me to add a feature.
---
### Disabling
#### Disable the comment in one post
If you wanna to disable the comment in a specific post, please add a line in the metadata area of the post:
```
comment : false
```
A more detailed description of the posts' meta data is [here](https://github.com/AmazingRise/hugo-theme-diary/wiki/Post's-meta-data).
#### Disable it globally
Please remove the settings item referred in "Add comment".
The comment area will not be shown.
|