Easily integrate the Gitalk comment system into your Hexo blog, a modern comment solution based on GitHub Issues.
| Feature | Description | Advantages |
|---|---|---|
| GitHub Integration | Based on GitHub Issues, no database required | Zero maintenance cost, high availability |
| OAuth Authentication | Supports GitHub OAuth secure login | Protects user privacy, secure and reliable |
| Theme Switching | Supports light/dark theme auto-switching | Perfectly adapts to various theme styles |
| Responsive Design | Adapts to various device screens | Mobile-friendly user experience |
| Multi-language Support | Supports multiple interface languages | Internationalization friendly |
| Easy Configuration | Simple YAML configuration | Quick setup, flexible customization |
# 1. Install multi-comment system core plugin (required)
npm install hexo-generator-comments --save
# 2. Install Gitalk comment plugin
npm install hexo-comments-gitalk --save
Note:
hexo-comments-gitalkneeds to be used withhexo-generator-commentsMore info: hexo-generator-comments
Add the following content to your Hexo site configuration _config.yml or theme configuration _config.yml, _config.[theme].yml:
gitalk:
# Enable Gitalk comment system
enable: false
# GitHub Application Client ID
client_id: your-client-id
# GitHub Application Client Secret
client_secret: your-client-secret
# GitHub repository name
repo: your-repo-name
# GitHub repository owner
github_id: your-github-id
# GitHub repository administrator
admin_user: your-github-id
# Page unique identifier
issue_term: pathname
# Language settings
language:
# Enable distraction-free mode
distraction_free_mode: true
# Proxy URL (optional)
proxy: https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token
Important: Replace the placeholders in the configuration with your actual GitHub application information
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
enable | Boolean | false | Yes | Enable Gitalk comment system |
client_id | String | - | Yes | GitHub Application Client ID |
client_secret | String | - | Yes | GitHub Application Client Secret |
repo | String | - | Yes | GitHub repository name for storing comments |
github_id | String | - | Yes | GitHub repository owner's username |
admin_user | String | - | Yes | GitHub repository administrator's username |
issue_term | String | pathname | Yes | How to generate page unique identifier |
language | String | navigator.language | No | Interface language settings |
distraction_free_mode | Boolean | true | Yes | Enable distraction-free mode |
proxy | String | - | No | Proxy URL for solving CORS issues |
issue_term Mapping Methods
| Value | Description | Use Cases |
|---|---|---|
pathname | Use page path as issue title | Recommended, suitable for most scenarios |
url | Use full page URL as issue title | When domain information is needed |
title | Use page title as issue title | When you want more friendly issue titles |
[issue-number] | Specify specific issue number | Manual comment management |
language Options
| Language Code | Language Name |
|---|---|
en | English |
zh-CN | Simplified Chinese |
zh-TW | Traditional Chinese |
es-ES | Spanish |
fr | French |
ru | Russian |
| ... | ... |
This plugin supports all Hexo themes using the following template engines:
| Template Engine | File Extension | Support Status |
|---|---|---|
| EJS | .ejs | ✅ Fully Supported |
| Nunjucks | .njk | ✅ Fully Supported |
| JSX + Inferno | .jsx | ✅ Fully Supported |
Before getting started, please ensure the following requirements are met:
Note: The Authorization callback URL of the OAuth application can be set to your blog domain
issue_term| Dependency | Version Requirement | Description |
|---|---|---|
| Node.js | >= 14.0.0 | JavaScript runtime environment |
| Hexo | >= 5.3.0 | Static site generator |
| GitHub Repository | Public repository | Stores comment data |
This project is open source under the MIT license.