@mrzhiin/modis
v2.0.3
Published
Comment service for web
Readme
Modis
Comment service for web
Getting Started
Installation
Use NPM or Yarn
npm i @mrzhiin/modis
yarn add @mrzhiin/modisUse Browser
- Full
<script src="path/modis.js"></script>- Lite
<script src="//cdn.jsdelivr.net/npm/[email protected]/dist/av-min.js"></script>
<script src="path/modis.slim.js"></script>Usage
<div id="modis"></div>
<script>
new Modis({
el: "#modis",
backend: "leancloud",
backendConfig: {
appId: "",
appKey: ""
}
});
</script>Options
| Option | Type | Description | Default |
| -------------------- | -------------- | -------------------------------------------------------- | ---------------------------------- |
| el | string/Element | CSS selector or Element | |
| locale | string | Language | zh-CN |
| gravatar | string | Gravatar request URL | https://www.gravatar.com/avatar/ |
| gravatarParameters | string | Gravatar request URL's combining parameters(Don't use s) | ?d=mp&s=60 |
| pageSize | number | Number of comment displayed per page | 10 |
| pathnameGenerator | function | | |
| theme | string | Theme | auto |
| backend | string | Backend service | leancloud |
| backendConfig | object | Backend service config | |
Backend service
leancloud
| Option | Type | Description | Default |
| -------- | ------- | -------------------- | ------- |
| appId | string | Leancloud App appId | |
| `appKey` | string | Leancloud App appKey | |
| spa | boolean | | false |
valine
| Option | Type | Description | Default |
| -------- | ------- | -------------------- | ------- |
| appId | string | Leancloud App appId | |
| `appKey` | string | Leancloud App appKey | |
| spa | boolean | | false |
