Skip to content

Commit 9888e23

Browse files
committed
fix(docs): refine docs and styles
1 parent e7ed2cf commit 9888e23

8 files changed

Lines changed: 137 additions & 49 deletions

File tree

docs/README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,23 @@ A simple, safe, serverless comment system based on Tencent CloudBase (tcb).
2222

2323
[https://www.imaegoo.com/2020/hello-twikoo/](https://www.imaegoo.com/2020/hello-twikoo/)
2424

25-
## 快速上手
26-
27-
请查看[快速上手](https://twikoo.js.org/quick-start.html)
28-
29-
> 文档尚未完善,请关注后续更新;<br>
30-
> 如果你想获取更新动态、建言献策、参与内测,欢迎加入内测群:<br>
31-
> <img height="300" alt="1080829142" src="https://www.imaegoo.com/gallery/2020/hello-twikoo.png" />
25+
## 交流群
26+
27+
如果你想获取更新动态、建言献策、参与内测,欢迎加入内测群:<br>
28+
<img height="300" alt="1080829142" src="https://www.imaegoo.com/gallery/2020/hello-twikoo.png" />
29+
30+
## 开发计划
31+
32+
| 状态 | 优先级 | 计划 |
33+
| ---- | ---- | ---- |
34+
| DONE | P0 | 文档撰写 |
35+
| TODO | P1 | 评论管理 |
36+
| TODO | P2 | 人工审核 |
37+
| TODO | P2 | AKISMET 审核 |
38+
| TODO | P2 | 完整 Markdown 适配 |
39+
| TODO | P3 | Emoji 表情 |
40+
| TODO | P3 | 图片表情 |
41+
| TODO | P3 | 评论框粘贴图片 |
3242

3343
<!-- ## 贡献者 | Contributors -->
3444

docs/configuration.md

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,92 +7,101 @@ Twikoo 的配置保存在数据库中,目前修改配置需进入控制台。
77
不过放心,默认权限是安全的,您不需要更改。
88
:::
99

10-
## AKISMET_KEY
10+
## 通用
11+
12+
### SITE_NAME
1113

1214
类型: `String`<br>
1315
默认值: `null`<br>
1416
必要性: `false`<br>
15-
示例: 8651783ed123
17+
示例: 虹墨空间站
1618

17-
反垃圾评论 API key
19+
博客、站点名称
1820

19-
## BLOGGER_EMAIL
21+
### SITE_URL
2022

2123
类型: `String`<br>
2224
默认值: `null`<br>
2325
必要性: `false`<br>
24-
示例: 12345@qq.com
26+
示例: https://www.imaegoo.com
2527

26-
博主的邮箱地址,用于邮件通知、博主标识
28+
博客、站点地址
2729

28-
## SC_SENDKEY
30+
### BLOGGER_EMAIL
2931

3032
类型: `String`<br>
3133
默认值: `null`<br>
3234
必要性: `false`<br>
33-
示例: SCT1364TKdsiGjGvyAZNYDVnuHW12345
35+
示例: 12345@qq.com
3436

35-
[Server酱](https://sc.ftqq.com/3.version)微信推送的 `SCKEY`
37+
博主的邮箱地址,用于邮件通知、博主标识。
3638

37-
## SENDER_EMAIL
39+
## 反垃圾
40+
41+
### AKISMET_KEY
3842

3943
类型: `String`<br>
4044
默认值: `null`<br>
4145
必要性: `false`<br>
42-
示例: blog@imaegoo.com
46+
示例: 8651783ed123
47+
48+
反垃圾评论 API key。
4349

44-
邮件通知,邮箱地址。
50+
## 微信通知
4551

46-
## SENDER_NAME
52+
### SC_SENDKEY
4753

4854
类型: `String`<br>
4955
默认值: `null`<br>
5056
必要性: `false`<br>
51-
示例: 虹墨空间站评论提醒
57+
示例: SCT1364TKdsiGjGvyAZNYDVnuHW12345
58+
59+
[Server酱](https://sc.ftqq.com/3.version)微信推送的 `SCKEY`
5260

53-
邮件通知,邮件标题。
61+
## 邮件通知
5462

55-
## SITE_NAME
63+
### SENDER_EMAIL
5664

5765
类型: `String`<br>
5866
默认值: `null`<br>
5967
必要性: `false`<br>
60-
示例: 虹墨空间站
68+
示例: blog@imaegoo.com
6169

62-
博客、站点名称
70+
邮件通知邮箱地址
6371

64-
## SITE_URL
72+
### SENDER_NAME
6573

6674
类型: `String`<br>
6775
默认值: `null`<br>
6876
必要性: `false`<br>
69-
示例: https://www.imaegoo.com
77+
示例: 虹墨空间站评论提醒
7078

71-
博客、站点地址
79+
邮件通知标题
7280

73-
## SMTP_PASS
81+
### SMTP_SERVICE
7482

7583
类型: `String`<br>
7684
默认值: `null`<br>
7785
必要性: `false`<br>
78-
示例: password
86+
示例: qiye.aliyun
7987

80-
邮件通知,邮箱密码,QQ邮箱请填写授权码。
88+
邮件通知邮箱服务商。<br>
89+
完整列表请参考:[Supported services](https://nodemailer.com/smtp/well-known/#supported-services)
8190

82-
## SMTP_SERVICE
91+
### SMTP_USER
8392

8493
类型: `String`<br>
8594
默认值: `null`<br>
8695
必要性: `false`<br>
87-
示例: qiye.aliyun
96+
示例: blog@imaegoo.com
8897

89-
邮件通知,邮箱服务商
98+
邮件通知邮箱用户名
9099

91-
## SMTP_USER
100+
### SMTP_PASS
92101

93102
类型: `String`<br>
94103
默认值: `null`<br>
95104
必要性: `false`<br>
96-
示例: blog@imaegoo.com
105+
示例: password
97106

98-
邮件通知,邮箱用户名
107+
邮件通知邮箱密码,QQ邮箱请填写授权码

docs/quick-start.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@
55
Twikoo 使用云开发作为评论后台,每个云开发用户均长期享受1个免费的标准型基础版1资源套餐。如果您已经拥有了一个免费版云开发环境,在环境配置符合要求的情况下,Twikoo 理论可以与其他项目共用一个环境。
66

77
1. [注册云开发CloudBase](https://curl.qcloud.com/KnnJtUom)
8-
2. 进入[云开发控制台](https://console.cloud.tencent.com/tcb/),新建环境,请按个人需要配置环境,推荐选择计费方式`包年包月`,套餐版本`基础班 1`
8+
2. 进入[云开发控制台](https://console.cloud.tencent.com/tcb/),新建环境,请按个人需要配置环境<br>
9+
::: tip 提示
10+
* 推荐选择计费方式`包年包月`,套餐版本`基础班 1`
11+
* 如果提示“选择部署应用”,请选择“不创建环境”
12+
:::
913
3. 进入[环境-登录授权](https://console.cloud.tencent.com/tcb/env/login),启用“匿名登录”
10-
4. 进入[环境-安全配置](https://console.cloud.tencent.com/tcb/env/safety)将网站地址添加到“WEB安全域名”
14+
4. 进入[环境-安全配置](https://console.cloud.tencent.com/tcb/env/safety)将网站域名添加到“WEB安全域名”
1115
5. 复制环境Id备用
1216

1317
## 环境部署
1418

1519
::: warning 注意
16-
请将命令、代码中“您的环境id”替换为您自己的环境id
20+
* 请确保您已经安装了 [Node.js](https://nodejs.org/en/download/)
21+
* 请将命令、代码中“您的环境id”替换为您自己的环境id
22+
* 请不要使用 Windows 自带的记事本编辑 envId.txt,否则会部署失败,后续会修复该问题
1723
:::
1824

19-
请确保您已经安装了 [Node.js](https://nodejs.org/en/download/)
20-
2125
1. 克隆本仓库
2226
``` sh
2327
git clone https://github.com/imaegoo/twikoo.git

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "twikoo",
3-
"version": "0.1.8",
3+
"version": "0.1.9",
44
"description": "A simple comment system based on Tencent CloudBase (tcb).",
55
"author": "imaegoo <hello@imaegoo.com> (https://github.com/imaegoo)",
66
"license": "MIT",

src/view/components/TkAction.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ export default {
3535
},
3636
computed: {
3737
likeCountStr () {
38-
return this.likeCount > 0 ? `(${this.likeCount})` : ''
38+
return this.likeCount > 0 ? `${this.likeCount}` : ''
3939
},
4040
repliesCountStr () {
41-
return this.repliesCount > 0 ? `(${this.repliesCount})` : ''
41+
return this.repliesCount > 0 ? `${this.repliesCount}` : ''
4242
}
4343
},
4444
methods: {

src/view/components/TkComment.vue

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
</a>
1111
<span class="tk-tag tk-tag-green" v-if="comment.master">博主</span>
1212
<small class="tk-time">{{ displayCreated }}</small>
13-
<div class="tk-tag">{{ comment.os }}</div>
14-
<div class="tk-tag">{{ comment.browser }}</div>
1513
</div>
1614
<tk-action :liked="comment.liked"
1715
:like-count="comment.like"
@@ -23,6 +21,10 @@
2321
<span v-if="comment.pid">回复 <a :href="`#${comment.pid}`">@{{ comment.ruser }}</a> :</span>
2422
<span v-html="comment.comment"></span>
2523
</div>
24+
<div class="tk-extras">
25+
<div class="tk-extra"><span class="tk-icon" v-html="iconOs"></span>&nbsp;{{ comment.os }}</div>
26+
<div class="tk-extra"><span class="tk-icon" v-html="iconBrowser"></span>&nbsp;{{ comment.browser }}</div>
27+
</div>
2628
<!-- 回复列表 -->
2729
<div class="tk-replies" :class="{ 'tk-replies-expand': isExpanded }" ref="tk-replies">
2830
<tk-comment v-for="reply in comment.replies"
@@ -47,6 +49,37 @@ import { timeago } from '../../js/utils'
4749
import TkAction from './TkAction.vue'
4850
import TkAvatar from './TkAvatar.vue'
4951
import TkSubmit from './TkSubmit.vue'
52+
import iconWindows from '@fortawesome/fontawesome-free/svgs/brands/windows.svg'
53+
import iconApple from '@fortawesome/fontawesome-free/svgs/brands/apple.svg'
54+
import iconAndroid from '@fortawesome/fontawesome-free/svgs/brands/android.svg'
55+
import iconLinux from '@fortawesome/fontawesome-free/svgs/brands/linux.svg'
56+
import iconUbuntu from '@fortawesome/fontawesome-free/svgs/brands/ubuntu.svg'
57+
import iconChrome from '@fortawesome/fontawesome-free/svgs/brands/chrome.svg'
58+
import iconFirefox from '@fortawesome/fontawesome-free/svgs/brands/firefox-browser.svg'
59+
import iconSafari from '@fortawesome/fontawesome-free/svgs/brands/safari.svg'
60+
import iconIe from '@fortawesome/fontawesome-free/svgs/brands/internet-explorer.svg'
61+
import iconEdge from '@fortawesome/fontawesome-free/svgs/brands/edge.svg'
62+
import iconOther from '@fortawesome/fontawesome-free/svgs/regular/window-maximize.svg'
63+
64+
65+
const osList = {
66+
win: iconWindows,
67+
mac: iconApple,
68+
ipad: iconApple,
69+
iphone: iconApple,
70+
android: iconAndroid,
71+
ubuntu: iconUbuntu,
72+
linux: iconLinux
73+
}
74+
75+
const browserList = {
76+
edge: iconEdge,
77+
chrome: iconChrome,
78+
firefox: iconFirefox,
79+
safari: iconSafari,
80+
explorer: iconIe,
81+
ie: iconIe
82+
}
5083
5184
export default {
5285
name: 'tk-comment', // 允许组件模板递归地调用自身
@@ -70,11 +103,24 @@ export default {
70103
displayCreated () {
71104
return timeago(this.comment.created)
72105
},
106+
iconOs () {
107+
return this.getIconBy(this.comment.os, osList)
108+
},
109+
iconBrowser () {
110+
return this.getIconBy(this.comment.browser, browserList)
111+
},
73112
showExpand () {
74113
return this.hasExpand && !this.isExpanded
75114
}
76115
},
77116
methods: {
117+
getIconBy (name, list) {
118+
const lowerCaseName = name.toLowerCase()
119+
for (let key in list) {
120+
if (lowerCaseName.indexOf(key) !== -1) return list[key]
121+
}
122+
return iconOther
123+
},
78124
showExpandIfNeed () {
79125
if (this.comment.replies && this.comment.replies.length > 0 && this.$refs['tk-replies']) {
80126
this.hasExpand = this.$refs['tk-replies'].scrollHeight > 200
@@ -141,6 +187,25 @@ export default {
141187
.tk-nick-link:hover {
142188
color: #409eff;
143189
}
190+
.tk-extras {
191+
color: #999999;
192+
font-size: 0.875em;
193+
display: flex;
194+
margin-top: 0.5rem;
195+
}
196+
.tk-extra {
197+
margin-right: 0.75rem;
198+
}
199+
.tk-icon {
200+
display: inline-block;
201+
height: 1em;
202+
width: 1em;
203+
line-height: 0;
204+
vertical-align: text-top;
205+
}
206+
.tk-icon /deep/ svg {
207+
fill: currentColor;
208+
}
144209
.tk-tag {
145210
display: inline-block;
146211
padding: 0 0.5rem;

src/view/components/TkFooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="tk-footer">
33
Powered by <a href="https://github.com/imaegoo/twikoo" target="_blank">Twikoo</a>
4-
v {{ version }}
4+
v{{ version }}
55
</div>
66
</template>
77

src/view/components/TkSubmit.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
v-model="comment"
1010
placeholder="请输入内容"
1111
:autosize="{ minRows: 3 }"
12-
@change="updatePreview" />
12+
@input="updatePreview" />
1313
</div>
1414
</div>
1515
<div class="tk-row actions">

0 commit comments

Comments
 (0)