This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(comment): add twikoo and giscus
- Loading branch information
1 parent
025a429
commit 417eaa6
Showing
38 changed files
with
1,007 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
title: Giscus Options | ||
icon: github | ||
--- | ||
|
||
## repo | ||
|
||
- Type: `string` | ||
- Required: No | ||
|
||
The name of repository to store discussions. | ||
|
||
## repoId | ||
|
||
- Type: `string` | ||
- Required: No | ||
|
||
The ID of repository to store discussions. Generate through [Giscus Page](https://giscus.app/) | ||
|
||
## category | ||
|
||
- Type: `string` | ||
- Required: No | ||
|
||
The name of the discussion category. | ||
|
||
## categoryId | ||
|
||
- Type: `string` | ||
- Required: No | ||
|
||
The ID of the discussion category. Generate through [Giscus Page](https://giscus.app/) | ||
|
||
## mapping | ||
|
||
- Type: `string` | ||
- Default: `"pathname"` | ||
|
||
Page - Discussion mapping. For details see [Giscus Page](https://giscus.app/) | ||
|
||
## reactionsEnabled | ||
|
||
- Type: `boolean` | ||
- Default: `true` | ||
|
||
Whether enable reactions or not | ||
|
||
## inputPosition | ||
|
||
- Type: `"top" | "bottom"` | ||
- Default: `"top"` | ||
|
||
Input position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Twikoo Options | ||
icon: comment | ||
--- | ||
|
||
## envId | ||
|
||
- Type: `string` | ||
- Required: Yes | ||
|
||
Vercel address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: Giscus | ||
icon: github | ||
--- | ||
|
||
Giscus is a GitHub Discussion based commenting system that is easy to start. | ||
|
||
<!-- more --> | ||
|
||
## Preparation | ||
|
||
1. You need to create a public repository and open discussion as a place to store comments | ||
1. You need to install the [Giscus App](https://github.com/apps/giscus) to have permission to access the corresponding repository. | ||
|
||
After completing the above steps, please go to the [Giscus page](https://giscus.app) to get your settings. You just need to fill in the repository and Discussion categories, then scroll to the "Enable giscus" section at the bottom of the page and copy the `data-repo`, `data-repo-id`, `data-category` and `data-category-id` four items as they are required. | ||
|
||
## Config | ||
|
||
Please pass `data-repo`, `data-repo-id`, `data-category` and `data-category-id` as plugin options as `repo`, `repoId`, `category` `categoryId`. | ||
|
||
::: info Darkmode | ||
|
||
To let Giscus use the correct theme, you need to pass a boolean value to `<CommentService />` via the `darkmode` property, indicating whether darkmode is currently enabled. | ||
|
||
::: | ||
|
||
For other options, see [Giscus Config](../config/giscus.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Twikoo | ||
icon: comment | ||
--- | ||
|
||
A concise, safe and free static site commenting system, based on [Tencent Cloud Development](https://curl.qcloud.com/KnnJtUom). | ||
|
||
<!-- more --> | ||
|
||
## Getting started | ||
|
||
### Vercel Deployment | ||
|
||
1. Apply for [MongoDB](https://www.mongodb.com/cloud/atlas/register) account | ||
1. Create a free MongoDB database, the recommended region is `AWS / N. Virginia (us-east-1)` | ||
1. Click CONNECT on the Clusters page, follow the steps to allow connections from all IP addresses ([Why?](https://vercel.com/support/articles/how-to-allowlist-deployment-ip-address)), create Database user, and record the database connection string, please change the `<password>` in the connection string to the database password | ||
1. Sign up for a [Vercel](https://vercel.com/signup) account | ||
1. Click the button below to deploy Twikoo to Vercel in one click | ||
|
||
[![Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/imaegoo/twikoo/tree/dev/src/vercel-min) | ||
|
||
1. Go to Settings - Environment Variables, add the environment variable `MONGODB_URI`, the value is the database connection string in step 3 | ||
1. Go to Overview, click the link under Domains, if the environment configuration is correct, you can see the prompt "Twikoo cloud function is running normally" | ||
1. Vercel Domains (with `https://` prefix, eg `https://xxx.vercel.app`) is your environment ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
title: Giscus 选项 | ||
icon: github | ||
--- | ||
|
||
## repo | ||
|
||
- 类型: `string` | ||
- 必填: 是 | ||
|
||
存放评论的仓库 | ||
|
||
## repoId | ||
|
||
- 类型: `string` | ||
- 必填: 是 | ||
|
||
仓库 ID,请从 [Giscus 页面](https://giscus.app/zh-CN) 生成。 | ||
|
||
## category | ||
|
||
- 类型: `string` | ||
- 必填: 是 | ||
|
||
讨论分类 | ||
|
||
## categoryId | ||
|
||
- 类型: `string` | ||
- 必填: 是 | ||
|
||
讨论分类 ID,请从 [Giscus 页面](https://giscus.app/zh-CN) 生成。 | ||
|
||
## mapping | ||
|
||
- 类型: `string` | ||
- 默认值: `"pathname"` | ||
|
||
页面 ↔️ discussion 映射关系,详见 [Giscus 页面](https://giscus.app/zh-CN)。 | ||
|
||
## reactionsEnabled | ||
|
||
- 类型: `boolean` | ||
- 默认值: `true` | ||
|
||
是否启用主帖子上的反应 | ||
|
||
## inputPosition | ||
|
||
- 类型: `"top" | "bottom"` | ||
- 默认值: `"top"` | ||
|
||
输入框的位置 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Twikoo 选项 | ||
icon: comment | ||
--- | ||
|
||
## envId | ||
|
||
- 类型: `string` | ||
- 必填: 是 | ||
|
||
腾讯云环境 ID 或 Vercel 地址。 | ||
|
||
## repoId | ||
|
||
- 类型: `string` | ||
- 默认值: `"ap-shanghai"` | ||
|
||
腾讯云区域。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: Giscus | ||
icon: github | ||
--- | ||
|
||
Giscus 是一个基于 GitHub Discussion 的评论系统,启用简便。 | ||
|
||
<!-- more --> | ||
|
||
## 准备工作 | ||
|
||
1. 你需要创建一个公开仓库,并开启评论区,以作为评论存放的地点 | ||
1. 你需要安装 [Giscus App](https://github.com/apps/giscus),使其有权限访问对应仓库。 | ||
|
||
在完成以上步骤后,请前往 [Giscus 页面](https://giscus.app/zh-CN) 获得你的设置。你只需要填写仓库和 Discussion 分类,之后滚动到页面下部的 “启用 giscus” 部分,复制 `data-repo`, `data-repo-id`, `data-category` 和 `data-category-id` 四项,因为它们是必须的。 | ||
|
||
## 配置 | ||
|
||
请将 `data-repo`, `data-repo-id`, `data-category` 和 `data-category-id` 作为插件选项传入 `repo`, `repoId`, `category` `categoryId`。 | ||
|
||
::: info 夜间模式 | ||
|
||
为了能使 Giscus 使用正确的主题,你需要为 `<CommentService />` 通过 `darkmode` 属性传入一个布尔值,代表当前是否开启夜间模式。 | ||
|
||
::: | ||
|
||
其他的配置项详见 [Giscus 配置](../config/giscus.md)。 |
Oops, something went wrong.