💬
Coalk
is comment component base on firebase realtime database for static pages.
Note: This project is developing.
- Simple and lightweight.
- No server-side implementation.
- Support on authentication with gravatr json API.
- Serverless, data be stored in firebase realtime database.
- Via npm :
$ npm i coalk
- Import CDN :
<!-- Temporary vacancy -->
- Build files :
$ npm i
$ npm run build
Then generate coalk.min.css
and coalk.min.js
and their sourcemap files in dist
folder.
Add a container to you page:
<div id="coalk"></div>
Then use the Javascript code below to new a comment instance:
<script>
new Coalk({
apiKey: 'Firebase apiKey',
databaseURL: 'Firebase databaseURL',
authDomain: "Firebase authDomain",
// And other options setting.
});
</script>
Option | Default | Description |
---|---|---|
cdn |
https://gravatar.loli.net/avatar/ |
string The gravatar CDN url. |
row |
8 |
number The comment maximum number loaded initially. |
language |
navigator.browserLanguage.toLowerCase() |
string The language setting, values: 'en', 'zh-cn'. |
apiKey |
null |
string Your firebase apiKey. |
authDomain |
null |
string Your firebase Authentication authDomain. |
databaseURL |
null |
string Your firebase realtime database databaseURL. |
$ git clone git@github.com:huiyifyj/comment.js.git
$ cd comment.js
$ npm install
$ npm run dev
Then open your browser, visit http://127.0.0.1:3000/ .
© 2019 | Huiyi.FYJ