gridsome-plugin-gitalk v0.4.0
Gridsome Plugin Gitalk
A plugin that simplifies adding Gitalk comments to Gridsome.
Installation
# For npm
$ npm install gridsome-plugin-gitalk
# For yarn
$ yarn add gridsome-plugin-gitalkTutorial
Refer to this blog for a detailed tutorial on how to use and configure this plugin.
Usage
Add this plugin to your gridsome.config.js
plugins: [
{
use: 'gridsome-plugin-gitalk',
options: {
clientID: '',
... // Gitalk config
}
}
]Then simply add the following line to your Vue files.
<Gitalk />You can also specify options in the component itself like.
<Gitalk :config={
id: 'hi',
...
} />Note: If same option is specified in the
gridsome.config.jsand the component. The value in the component would be considered.
Config Options
clientID
StringRequired. GitHub Application Client ID.
clientSecret
StringRequired. GitHub Application Client Secret.
repo
StringRequired. GitHub repository.
owner
StringRequired. GitHub repository owner. Can be personal user or organization.
admin
ArrayRequired. GitHub repository owner and collaborators. (Users who having write access to this repository)
id
StringDefault:
location.href.The unique id of the page. Length must less than 50.
number
NumberDefault:
-1.The issue ID of the page, if the
numberattribute is not defined, issue will be located usingid.labels
ArrayDefault:
['Gitalk'].GitHub issue labels.
title
StringDefault:
document.title.GitHub issue title.
body
StringDefault:
location.href + header.meta[description].GitHub issue body.
language
StringDefault:
navigator.language || navigator.userLanguage.Localization language key,
en,zh-CNandzh-TWare currently available.perPage
NumberDefault:
10.Pagination size, with maximum 100.
distractionFreeMode
BooleanDefault: false.
Facebook-like distraction free mode.
pagerDirection
StringDefault: 'last'
Comment sorting direction, available values are
lastandfirst.createIssueManually
BooleanDefault:
false.By default, Gitalk will create a corresponding github issue for your every single page automatically when the logined user is belong to the
adminusers. You can create it manually by setting this option totrue.proxy
StringDefault:
https://cors-anywhere.herokuapp.com/https://github.com/login/oauth/access_token.GitHub oauth request reverse proxy for CORS. Why need this?
flipMoveOptions
ObjectDefault:
{ staggerDelayBy: 150, appearAnimation: 'accordionVertical', enterAnimation: 'accordionVertical', leaveAnimation: 'accordionVertical', }Comment list animation. Reference
enableHotKey
BooleanDefault:
true.Enable hot key (cmd|ctrl + enter) submit comment.
License (MIT)
Open LICENSE file for more info