Vssue Config
# platform
@vssue/vuepress-plugin-vssue will auto resolve the corresponding API package according to the value of platform:
- Platform
github- API package@vssue/api-github-v3 - Platform
github-v4- API package@vssue/api-github-v4 - Platform
gitlab- API package@vssue/api-gitlab-v4 - Platform
bitbucket- API package@vssue/api-bitbucket-v2 - Platform
gitee- API package@vssue/api-gitee-v5 - Platform
gitea- API package@vssue/api-gitea-v1
# owner
Type:
stringDetails:
The owner’s name of repository to store the issues and comments. Could be the name of a user or an organization (GitHub Organization / Gitlab Group / Bitbucket Team).
Together with
repo, Vssue could locate the repository on the platform.Reference: repo
# repo
Type:
stringDetails:
The name of repository to store the issues and comments.
Together with
owner, Vssue could locate the repository on the platform.Reference: owner
Tips
The common pattern of repository’s URL is `${baseURL}/${owner}/${repo}`:
- GitHub:
https://github.com/${owner}/${repo} - Gitlab:
https://gitlab.com/${owner}/${repo} - Bitbucket:
https://bitbucket.org/${owner}/${repo} - Gitee:
https://gitee.com/${owner}/${repo}
# clientId
Type:
stringDetails:
The
client_idintroduced in OAuth2 spec (opens new window).It’s the client identifier that issued by the platform. You will get it after you set up OAuth App.
Vssue will use it to get user’s access token.
Reference:
# clientSecret
Type:
stringDefault:
undefinedDetails:
The
client_secretintroduced in OAuth2 spec (opens new window).It’s the client secret that generated by the platform. You will get it after you set up OAuth App.
When work with some of the platforms, Vssue will use it together with
clientIdto get user’s access token.Tips
Some platforms (for example Bitbucket and GitLab) support Implicit Grant (opens new window), so we don’t need
clientSecretfor those platforms. Mean while, some platforms (for example GitHub and Gitee) do not support it now, soclientSecretis required for those platforms.Reference:
# baseURL
Type:
stringDefault:
undefined(according to the platform)Details:
This is the base URL of your platform.
Default values for supported platforms are:
'https://github.com'for GitHub'https://gitlab.com'for Gitlab'https://bitbucket.org'for Bitbucket'https://gitee.com'for Gitee
Note
Only when you choose to use self-hosted platform should you set this option. (for example GitLab Community / Enterprise Edition or GitHub Enterprise Server)
Reference:
# state
Type:
stringDefault:
'Vssue'Details:
The
stateelement introduced in OAuth2 spec (opens new window).Vssue will send it with OAuth redirection and check whether matched in callback.
It’s designed for preventing CSRF (opens new window), but it’s not so useful here as we put everything in a static page, you can ignore it or set it to anything you like.
# labels
Type:
stringDefault:
['Vssue']Details:
To set the labels of issues that Vssue uses.
Vssue will only request those issues with the labels and ignore others. Together with
title,labelswill help to identify the corresponding issue of Vssue. If you use multiple labels by setting more strings, only issues with all those labels will be requested by Vssue.Tips
Bitbucket does not support issue labels for now, so this option will be ignored if you are using Bitbucket.
GitHub supports emoji in labels’ name, for example
[':heart:Vssue', ':mailbox:Comments'].Reference: title
# prefix
Type:
stringDefault:
'[Vssue]'Details:
The title prefix for issues. Used for generating the actual title of the corresponding issue.
For example, if the
prefixis'[Vssue]'and thetitleis'Vssue Demo', the actual title of the corresponding issue is'[Vssue]Vssue Demo'.It will be ignored if the type of
titleisFunction.Reference: title
# admins
Type:
string[]Default:
[]Details:
Array of username that has admin access to Vssue. The
owneralways has admin access.Users with admin access can delete all comments, while other users can only delete their own comments.
Only
adminscan auto create corresponding issue if it does not exist.Tips
To auto create the issue when the
owneris a organization rather than a user, you can add your username intoadmins.Reference: owner
# perPage
Type:
numberDefault:
10Details:
The default value of comments to show per page.
# locale
Type:
stringDefault:
undefinedDetails:
The locale language.
If not set, Vssue will use one of
window.navigator.languages, or fallback to'en'.Tips
Vssue uses vue-i18n (opens new window) for i18n, but it will not affect other parts of your Vue App. And if you already have vue-i18n in your project, it will not affect Vssue.
Language packages locate in src/i18n/langs (opens new window) directory. We have supported:
'en'('en-US')'zh'('zh-CN')'pt'('pt-BR')'ja'('ja-JP')
Contributions welcome for more languages support.
# proxy
Type:
string | ((url: string) => string)Default:
url => `https://cors-anywhere.herokuapp.com/${url}`Details:
Some platforms (for example GitHub and Gitee) do not support Implicit Grant, so we have to request the API of the platform to get the access token.
However, the access token API of the platforms do not support CORS (see related issue of GitHub (opens new window)). As Vssue is a pure frontend plugin, we have to use a proxy to request access token.
By default, we use an open source CORS proxy service cors-anywhere (opens new window) for that.
To use your own proxy, you need to set this option.
If the platform you use does not require
clientSecret, this option will be ignored.Example:
proxy: (url) => `https://your.cors.porxy?target=${url}`;1Reference:
# issueContent
Type:
((param: { options: Vssue.Options, url: string }) => string | Promise<string>)Default:
({ url }) => urlDetails:
The content of issue that auto created by Vssue.
Vssue will use the return value of the function as the content.
The parameter includes two properties:
optionsis the options of Vssue.urlis the URL of current page.
Example:
issueContent: ({ url }) => `This issue is auto created by Vssue to store comments of this page: ${url}`;1
2Tips
The
issueContentoption is only used to auto create the corresponding issue when it does not exist.If the issue already exists, Vssue will not try to update the content.
# autoCreateIssue
Type:
booleanDefault:
falseDetails:
If
autoCreateIssueis set totrue, Vssue will try to create an issue automatically when the corresponding issue does not exist. Notice that if you have not logged-in, Vssue will redirect to the authorization page automatically.If
autoCreateIssueis set tofalse, you need to create the issue manually.