Skip to content

Commit

Permalink
doc(quick): update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
imaegoo committed Sep 13, 2020
1 parent 906fac9 commit e7ed2cf
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
.npmignore
_config.js
cloudbaserc.js
dist/demo.css
dist/demo.html
dist/index.html
docs
envId.txt
node_modules
public
src
Expand Down
2 changes: 1 addition & 1 deletion cloudbaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require('fs')

let envId
try {
envId = fs.readFileSync('envId.txt').trim()
envId = fs.readFileSync('./envId.txt').toString().trim()
} catch (e) {
throw new Error('无法读取环境id,请先配置 envId.txt')
}
Expand Down
11 changes: 10 additions & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ module.exports = {
'/',
'/quick-start',
'/configuration'
]
],
lastUpdated: true,
// 假定是 GitHub. 同时也可以是一个完整的 GitLab URL
repo: 'imaegoo/twikoo',
// 假如文档不是放在仓库的根目录下:
docsDir: 'docs',
// 假如文档放在一个特定的分支下:
docsBranch: 'dev',
// 默认是 false, 设置为 true 来启用
editLinks: true
},
plugins: [
['@oak-tree-house/encrypt']
Expand Down
42 changes: 38 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# 介绍
# 简介

一个(仍处于开发初期的)简洁、安全、无后端的静态网站评论系统,基于腾讯云开发。<br>
A simple, safe, serverless comment system based on Tencent CloudBase (tcb).
[![](https://img.shields.io/npm/v/twikoo)](https://www.npmjs.com/package/twikoo)
[![](https://img.shields.io/npm/dt/twikoo)](https://www.npmjs.com/package/twikoo)
[![](https://img.shields.io/npm/l/twikoo)](https://github.com/imaegoo/twikoo/blob/dev/LICENSE)

![Demo](./demo.png)
一个简洁、安全、无后端的静态网站评论系统,基于腾讯云开发。<br>
A simple, safe, serverless comment system based on Tencent CloudBase (tcb).

## 特色

Expand All @@ -15,3 +17,35 @@ A simple, safe, serverless comment system based on Tencent CloudBase (tcb).
* 存储安全 | Security
* 反垃圾评论 | Akismet
* 邮件 / 微信通知 | Email / WeChat notify

## 预览

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

## 快速上手

请查看[快速上手](https://twikoo.js.org/quick-start.html)

> 文档尚未完善,请关注后续更新;<br>
> 如果你想获取更新动态、建言献策、参与内测,欢迎加入内测群:<br>
> <img height="300" alt="1080829142" src="https://www.imaegoo.com/gallery/2020/hello-twikoo.png" />
<!-- ## 贡献者 | Contributors -->

<!-- ## 捐赠 | Donate -->

## 开发

```
npm run serve
npm run build
```

## 国际化

鉴于腾讯云在中国以外地区的支持程度,本项目暂无国际化计划。<br>
There are no plans to internationalize this project.

## 许可

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fimaegoo%2Ftwikoo.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fimaegoo%2Ftwikoo?ref=badge_large)
27 changes: 22 additions & 5 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 环境初始化

Twikoo 使用云开发作为评论后台,每个云开发用户均长期享受1个免费的标准型基础版1资源套餐。
Twikoo 使用云开发作为评论后台,每个云开发用户均长期享受1个免费的标准型基础版1资源套餐。如果您已经拥有了一个免费版云开发环境,在环境配置符合要求的情况下,Twikoo 理论可以与其他项目共用一个环境。

1. [注册云开发CloudBase](https://curl.qcloud.com/KnnJtUom)
2. 进入[云开发控制台](https://console.cloud.tencent.com/tcb/),新建环境,请按个人需要配置环境,推荐选择计费方式`包年包月`,套餐版本`基础班 1`
Expand All @@ -18,10 +18,11 @@ Twikoo 使用云开发作为评论后台,每个云开发用户均长期享受1

请确保您已经安装了 [Node.js](https://nodejs.org/en/download/)

1. [下载](https://github.com/imaegoo/twikoo/archive/dev.zip)或克隆本仓库
1. 克隆本仓库
``` sh
git clone https://github.com/imaegoo/twikoo.git
```
> 如果您没有安装 Git,也可以从 [Release](https://github.com/imaegoo/twikoo/releases) 页面下载最新的 Source code
2. 安装依赖项
``` sh
npm install # 或 yarn install
Expand All @@ -38,13 +39,29 @@ npm run login # 或 yarn login
``` sh
npm run deploy # 或 yarn deploy
```
> 更新 Twikoo 版本时,请再次执行此命令更新现有的云函数
## 在页面中使用
## 使用

### 通过 CDN 引入

``` html
...
<div id="twikoo"></div>
<script src="https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js"></script>
<script>twikoo.init({ envId: '您的环境id' })</script>
...
```

### 通过 NPM 引入

``` sh
npm install twikoo # 或 yarn add twikoo
```

``` html
<div id="twikoo"></div>
```

``` js
import twikoo from 'twikoo' // 或 const twikoo = require('twikoo')
twikoo.init({ envId: '您的环境id' })
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twikoo",
"version": "0.1.7",
"version": "0.1.8",
"description": "A simple comment system based on Tencent CloudBase (tcb).",
"author": "imaegoo <hello@imaegoo.com> (https://github.com/imaegoo)",
"license": "MIT",
Expand Down

0 comments on commit e7ed2cf

Please sign in to comment.