Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

minivaline

3.1.5 • Public • Published

This is MiniValine version 3.x


version NPM GPL Licence npm downloads gzip-size FOSSA Status

Build Status Build Status Mergify Status codecov Codacy Badge DeepScan grade

MiniValine is a simple and minimalist comment system based on Leancloud


Live Demo

Awesome MiniValine

MiniValine FAQs

Features

Install

Two ways.

  • links
<script src="https://unpkg.com/minivaline@3/dist/MiniValine.min.js"></script>
 
<!-- or -->
 
<script src="https://cdn.jsdelivr.net/npm/minivaline@3/dist/MiniValine.min.js"></script>
 
<!-- or -->
 
<script src="https://cdn.jsdelivr.net/gh/MiniValine/MiniValine@3/dist/MiniValine.min.js"></script>
  • npm install
# Install minivaline
npm install minivaline --save
// Use import
import MiniValine from 'minivaline';
// or Use require
const MiniValine = require('minivaline');
 
new MiniValine({
    el:'#vcomments',
    // other config
})

Get App ID/App Key

Get App ID/App Key from LeanCloud
Click here to register or login in LeanCloud.
Click here Create new application in LeanCloud, and you will get appId/appKey.

Usage

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>MiniValine - A simple comment system based on Leancloud.</title>
    <!--Load js and insert it before </ body>-->
    <script src="https://unpkg.com/minivaline/dist/MiniValine.min.js"></script> 
</head>
<body>
    <div class="comment"></div>
    <script>
      new MiniValine({
          el: '.comment',
          appId: 'Your App ID',
          appKey: 'Your Key',
          placeholder: 'Write a Comment O(∩_∩)O~~'
      });
    </script> 
</body>
</html>

Options

Base Options

  • el String

    Required. [object HTMLDivElement]

  • appId String

    Required. Your App ID

  • appKey String

    Required. Your App Key

  • placeholder String

    Input Placeholder

  • pathname String

    Default: location.pathname

    The pathname of the page.

  • math Boolean

    Default: true

    Options:

    • false Close MathJax.
    • true Support MathJax@3 initialization.

    The above is the initialization operation of integrating MathJax in MiniValine. If MathJax is loaded on the page, MiniValine will use the MathJax version on the page.

  • md Boolean

    Default: true

    Support Markdown.

  • dark Boolean

    Default: false

    Dark model.

  • lang String

    Default: navigator.language || navigator.userLanguage.

    Localization language key, en and zh-CN are currently available.

    More i18n info: minivaline-i18n

    How to Add or Improve translation?

  • emoticonUrl String Array

    Default: ['https://cdn.jsdelivr.net/npm/alus@latest','https://cdn.jsdelivr.net/gh/MiniValine/qq@latest','https://cdn.jsdelivr.net/gh/MiniValine/Bilibilis@latest','https://cdn.jsdelivr.net/gh/MiniValine/tieba@latest','https://cdn.jsdelivr.net/gh/MiniValine/twemoji@latest','https://cdn.jsdelivr.net/gh/MiniValine/weibo@latest']

    Expression Url.

    How to customize emoticons?

  • NoRecordIP Boolean

    Default: false

    Do not record commenter IP.

  • maxNest Number

    Default: 6

    Sub-comment maximum nesting depth.

  • pageSize Number

    Default: 6

    Pagination size.

  • enableQQ Boolean

    Default: false

    Enable QQ avatar API.

  • visitor Boolean

    Default: true

    Only article reading access statisticsand whole site access statistics are provided. For other functions, please set it to "false" and configure MiniValine Counterby yourself.

    MiniValine Counter

  • serverURLs String

    Default: http[s]://[tab/us].avoscloud.com

    This configuration is suitable for domestic custom domain name users, the overseas version will be automatically detected (no need to fill in manually).

  • barrager Number

    Default: 1

    Options:

    • 0 Close Comment barrage.
    • 1 Load a round of Comment barrage.
    • 2 Load all round of Comment barrage

    Comment barrage. [Load only when the page is first loaded]

  • role String

    Default: admin

    Write permissions for the administrator role.

    Valine-Android Valine-iOS

Mode Options

  • mode String

    Default: DesertsP

    Options:

    • DesertsP DesertsP Style mode.
    • xCss xCss Style mode.

DesertsP Style mode Options

visitor flag
  • adminEmailMd5 String

    The MD5 of Admin Email to show Admin Flag.

xCss Style mode Options

visitor flag
  • closeFlag Boolean

    Default: false

    Turn off visitor flag.

Visitor Flag Local Options
  • master String Array

    Default: []

    The MD5 String Array of master Email to show master Flag.

  • friends String Array

    Default: []

    The MD5 String Array of friends Email to show friends Flag.

  • tagMeta String Array

    Default: []

    The String Array of Words to show Flag (only three).

    For Example: tagMeta: ["Master", "Friend", "Visitor"]

Visitor Flag Cloud Option
xCss Style mode Others Options
  • region Boolean

    Default: false

    According to IP output area.

    Note: Currently only Chinese API is available. NoRecordIP: false.

  • closeUA Boolean

    Default: false

    Turn off UA detection.

ToDo

  • Extraction from the core library to reduce volume.

  • Project engineering

  • Component modularity

  • And more.

Feedback

About

  • This project is always open source and free.
  • This project does not have any competitive relationship with any other project.
  • This project is a collection of inspiration from the Valine family. Thanks to every developer for their inspiration and contribution.
  • The project is open source only for sharing, developers are not obliged to provide after-sales service.

Contributing

We welcome you to join the development of MiniValine. Please see contributing document. 🤗

Also, we welcome Issue or PR to MiniValine.

Contributors

Code Contributors

This project exists thanks to all the people who contribute.

contributors-image

Thanks

Tribute to excellent open source! Tribute to excellent sharers!

Tribute to @xCss and @DesertsP!

Powered by MathJax

License

GPL-3.0

FOSSA Status

Install

npm i minivaline

DownloadsWeekly Downloads

1,287

Version

3.1.5

License

GPL-3.0

Unpacked Size

712 kB

Total Files

25

Last publish

Collaborators

  • avatar