All Projects → gitalk → Gitalk

gitalk / Gitalk

Licence: mit
Gitalk is a modern comment component based on Github Issue and Preact.

Programming Languages

javascript
184084 projects - #8 most used programming language
stylus
462 projects
HTML
75241 projects

Projects that are alternatives of or similar to Gitalk

Chartjs Plugin Datalabels
Chart.js plugin to display labels on data elements
Stars: ✭ 545 (-90.57%)
Mutual labels:  plugin
Goloader
load and run golang code at runtime. (WARNING: this repo has not been maintained for a long time, please take a look at https://github.com/pkujhd/goloader)
Stars: ✭ 564 (-90.24%)
Mutual labels:  plugin
Sonobus
Source code for SonoBus, a real-time network audio streaming collaboration tool.
Stars: ✭ 586 (-89.86%)
Mutual labels:  plugin
Hexo Tag Aplayer
Embed aplayer in Hexo posts/pages
Stars: ✭ 552 (-90.45%)
Mutual labels:  plugin
Small
A small framework to split app into small parts
Stars: ✭ 5,012 (-13.26%)
Mutual labels:  plugin
Nord Tmux
An arctic, north-bluish clean and elegant tmux color theme.
Stars: ✭ 567 (-90.19%)
Mutual labels:  plugin
Comfortable Motion.vim
Brings physics-based smooth scrolling to the Vim world!
Stars: ✭ 543 (-90.6%)
Mutual labels:  plugin
Engintron
Engintron for cPanel/WHM is the easiest way to integrate Nginx on your cPanel/WHM server. Engintron will improve the performance & web serving capacity of your server, while reducing CPU/RAM load at the same time, by installing & configuring the popular Nginx webserver to act as a reverse caching proxy in front of Apache.
Stars: ✭ 587 (-89.84%)
Mutual labels:  plugin
50weekly
50weekly 发现高质量的前端资源 第三十六周已更新
Stars: ✭ 560 (-90.31%)
Mutual labels:  preact
Blender Power Sequencer
Add-on for video editing in Blender 3D: edit videos faster! Included in Blender 2.81+
Stars: ✭ 577 (-90.01%)
Mutual labels:  plugin
Xanalyzer
xAnalyzer plugin for x64dbg
Stars: ✭ 553 (-90.43%)
Mutual labels:  plugin
Flask State
Display machine state using Python3 with Flask.
Stars: ✭ 553 (-90.43%)
Mutual labels:  plugin
Vuex Persistedstate
💾 Persist and rehydrate your Vuex state between page reloads.
Stars: ✭ 5,561 (-3.76%)
Mutual labels:  plugin
Awesome Preact
A curated list of amazingly awesome things regarding Preact ecosystem 🌟
Stars: ✭ 546 (-90.55%)
Mutual labels:  preact
Packem
📦⚡ A precompiled JavaScript module bundler
Stars: ✭ 586 (-89.86%)
Mutual labels:  plugin
Nyancss
🌈 Write plain CSS while reaping benefits of CSS-in-JS
Stars: ✭ 544 (-90.58%)
Mutual labels:  preact
Cp Ddd Framework
A lightweight flexible development framework for complex business architecture with full ecosystem!轻量级业务中台开发框架,中台架构的顶层设计和完整解决方案!
Stars: ✭ 566 (-90.2%)
Mutual labels:  plugin
Poi
⚡A zero-config bundler for JavaScript applications.
Stars: ✭ 5,291 (-8.43%)
Mutual labels:  preact
Gina.vim
👣 Asynchronously control git repositories in Neovim/Vim 8
Stars: ✭ 587 (-89.84%)
Mutual labels:  plugin
Androbd
Android OBD diagnostics with any ELM327 adapter
Stars: ✭ 573 (-90.08%)
Mutual labels:  plugin

Gitalk

NPM CDNJS jsdelivr david-dm travis coveralls gzip-size

Gitalk is a modern comment component based on GitHub Issue and Preact.

Features

  • Authentication with github account
  • Serverless, all comments will be stored as github issues
  • Both personal and organization github projects can be used to store comments
  • Localization, support multiple languages [en, zh-CN, zh-TW, es-ES, fr, ru, de, pl, ko, fa, ja]
  • Facebook-like distraction free mode (Can be enabled via the distractionFreeMode option)
  • Hotkey submit comment (cmd|ctrl + enter)

中文说明 Demo

Install

Two ways.

  • links
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
  <script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>

  <!-- or -->

  <link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
  <script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
  • npm install
npm i --save gitalk
import 'gitalk/dist/gitalk.css'
import Gitalk from 'gitalk'

Usage

Firstly, you need choose a public github repository (existed or create a new one) for store comments,

Then create A GitHub Application if you don't have one, Click here to register a new one. Note: You must specify the website domain url in the Authorization callback URL field.

Lastly, you can choose how to apply to the page as below:

Method One

Add a container to your page:

<div id="gitalk-container"></div>

Then use the Javascript code below to generate the gitalk plugin:

const gitalk = new Gitalk({
  clientID: 'GitHub Application Client ID',
  clientSecret: 'GitHub Application Client Secret',
  repo: 'GitHub repo',      // The repository of store comments,
  owner: 'GitHub repo owner',
  admin: ['GitHub repo owner and collaborators, only these guys can initialize github issues'],
  id: location.pathname,      // Ensure uniqueness and length less than 50
  distractionFreeMode: false  // Facebook-like distraction free mode
})

gitalk.render('gitalk-container')

Method Two: Use in React

Import the Gitalk with

import GitalkComponent from "gitalk/dist/gitalk-component";

And use the component like

<GitalkComponent options={{
  clientID: "...",
  // ...
  // options below
}} />

Options

  • clientID String

    Required. GitHub Application Client ID.

  • clientSecret String

    Required. GitHub Application Client Secret.

  • repo String

    Required. GitHub repository.

  • owner String

    Required. GitHub repository owner. Can be personal user or organization.

  • admin Array

    Required. GitHub repository owner and collaborators. (Users who having write access to this repository)

  • id String

    Default: location.href.

    The unique id of the page. Length must less than 50.

  • number Number

    Default: -1.

    The issue ID of the page, if the number attribute is not defined, issue will be located using id.

  • labels Array

    Default: ['Gitalk'].

    GitHub issue labels.

  • title String

    Default: document.title.

    GitHub issue title.

  • body String

    Default: location.href + header.meta[description].

    GitHub issue body.

  • language String

    Default: navigator.language || navigator.userLanguage.

    Localization language key, support [en, zh-CN, zh-TW, es-ES, fr, ru, de, pl, ko, fa, ja].

  • perPage Number

    Default: 10.

    Pagination size, with maximum 100.

  • distractionFreeMode Boolean

    Default: false.

    Facebook-like distraction free mode.

  • pagerDirection String

    Default: 'last'

    Comment sorting direction, available values are last and first.

  • createIssueManually Boolean

    Default: false.

    By default, Gitalk will create a corresponding github issue for your every single page automatically when the logined user is belong to the admin users. You can create it manually by setting this option to true.

  • proxy String

    Default: https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token.

    GitHub oauth request reverse proxy for CORS. Why need this?

  • flipMoveOptions Object

    Default:

      {
        staggerDelayBy: 150,
        appearAnimation: 'accordionVertical',
        enterAnimation: 'accordionVertical',
        leaveAnimation: 'accordionVertical',
      }

    Comment list animation. Reference

  • enableHotKey Boolean

    Default: true.

    Enable hot key (cmd|ctrl + enter) submit comment.

Instance Methods

  • render(String/HTMLElement)

    Init render and mount plugin.

TypeScript

TypeScript definitions for options and Gitalk class come with the package and should be automatically detected.

Definitions for React component usage are not included.

Contributing

  1. Fork the repository and create your branch from master
  2. If you've added code that should be tested, add tests!
  3. If you've changed APIs, update the documentation.
  4. Ensure the test suite passes (npm test).
  5. Make sure your code lints (npm run lint).
  6. Commit your changes (git commit) Commit Message Format Reference

Similar Projects

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].