{"id":21046585,"url":"https://github.com/talaxy009/gatsby-plugin-valine-comment","last_synced_at":"2026-04-18T07:31:56.413Z","repository":{"id":63838979,"uuid":"570936403","full_name":"Talaxy009/gatsby-plugin-valine-comment","owner":"Talaxy009","description":"Yet another Gatsby plugin for Valine comment system","archived":false,"fork":false,"pushed_at":"2023-02-13T11:37:46.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T09:05:14.067Z","etag":null,"topics":["comment","gatsby","gatsby-plugin","react","valine"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Talaxy009.png","metadata":{"files":{"readme":"README-zh.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-26T16:04:19.000Z","updated_at":"2022-12-13T14:07:36.000Z","dependencies_parsed_at":"2024-11-19T14:41:08.405Z","dependency_job_id":null,"html_url":"https://github.com/Talaxy009/gatsby-plugin-valine-comment","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":"0.11111111111111116","last_synced_commit":"cfeffb9b5231c16eb1bcd0d1beb670af85a27c54"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Talaxy009/gatsby-plugin-valine-comment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talaxy009%2Fgatsby-plugin-valine-comment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talaxy009%2Fgatsby-plugin-valine-comment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talaxy009%2Fgatsby-plugin-valine-comment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talaxy009%2Fgatsby-plugin-valine-comment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Talaxy009","download_url":"https://codeload.github.com/Talaxy009/gatsby-plugin-valine-comment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talaxy009%2Fgatsby-plugin-valine-comment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262933261,"owners_count":23386778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comment","gatsby","gatsby-plugin","react","valine"],"created_at":"2024-11-19T14:30:44.402Z","updated_at":"2026-04-18T07:31:56.384Z","avatar_url":"https://github.com/Talaxy009.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gatsby-plugin-valine-comment\n\n[![npm version](https://badge.fury.io/js/gatsby-plugin-valine-comment.svg)](https://badge.fury.io/js/gatsby-plugin-valine-comment)\n\n又一个为 Gatsby 站点嵌入 [Valine](https://valine.js.org/en/) 评论系统的插件。\n\n## ✨ 功能\n\n本插件能帮你在你的站点更轻松地使用 Valine 评论。\n\n- 使用 React Hooks API 对最新的 Valine 进行纯粹的封装\n- 支持 Valine 的所有配置\n- 由 TypeScript 编写\n\n## 🚚 安装\n\n```shell\nnpm install gatsby-plugin-valine-comment\n```\n\nor\n\n```shell\nyarn add gatsby-plugin-valine-comment\n```\n\n本插件依赖 **React v16.8** 或更高版本。\n\n## 🔦 Usage\n\n0. 如果你还没有 LeanCloud 的 AppId 和 AppKey, 请在[此处](https://valine.js.org/quickstart.html#%E8%8E%B7%E5%8F%96APP-ID-%E5%92%8C-APP-Key)查看如何获取。\n\n1. 修改你的 gatsby-config.js 文件以启用本插件\n\n    ```js\n    // 你的 gatsby-config.js\n    plugins: [\n        {\n            resolve: `gatsby-plugin-valine-comment`,\n            options: {\n                // 插件配置\n                appId: 'LEANCLOUD_APP_ID',\n                appKey: 'LEANCLOUD_APP_KEY',\n            },\n        },\n    ];\n    ```\n\n2. 在你的页面代码中使用 `\u003cValine /\u003e` 组件\n\n    ```jsx\n    import React from 'react';\n    import Valine from 'gatsby-plugin-valine-comment';\n\n    export default function Page({location}) {\n        return (\n            \u003cLayout\u003e\n                \u003cValine path={location.pathname} /*组件配置*/ /\u003e\n            \u003c/Layout\u003e\n        );\n    }\n    ```\n\n    插件配置项和组件配置项是一样的。你可以把常用配置 (如 `appId`, `appKey`, `avatar`) 放在插件配置中，把为页面单独配置的选项 (如 `path`) 放在组件配置中。配置会被合并且来自组件的配置有更高的优先级。\n\n在这之后，你应该能够在你的站点添加和查看评论了。\n\n## 🔧 配置项\n\n| 配置名         | 类型      | 默认值                             | 描述                                           |\n| -------------- | --------- | ---------------------------------- | ---------------------------------------------- |\n| appId          | `string`  | `null`                             | Leancloud 的 appId                             |\n| appKey         | `string`  | `null`                             | Leancloud 的 appKey                            |\n| placeholder    | `string`  | `Just go go`                       | 评论框占位                                     |\n| path           | `string`  | `window.location.pathname`         | 当前文章页路径，用于区分不同的文章页           |\n| pure           | `boolean` | `false`                            | 为 `true` 时插件会构建无样式的 valine 组件     |\n| avatar         | `string`  | `mp`                               | 头像，\u003chttps://valine.js.org/avatar.html\u003e      |\n| meta           | `array`   | `['nick','mail','link']`           | 评论者相关属性                                 |\n| pageSize       | `bumber`  | `10`                               | 评论者相关属性                                 |\n| lang           | `string`  | `zh-CN`                            | 多语言支持                                     |\n| langMode       | `object`  | `null`                             | 自定义语言，\u003chttps://valine.js.org/i18n.html\u003e  |\n| visitor        | `boolean` | `false`                            | 文章访问量统计                                 |\n| highlight      | `boolean` | `true`                             | 代码高亮，默认开启                             |\n| avatarForce    | `boolean` | `false`                            | 每次访问强制拉取最新的评论列表头像             |\n| recordIP       | `boolean` | `false`                            | 是否记录评论者 IP                              |\n| serverURLs     | `string`  | `http[s]://[tab/us].avoscloud.com` | 适用于国内自定义域名用户                       |\n| emojiCDN       | `string`  |                                    | 表情包 CDN, \u003chttps://valine.js.org/emoji.html\u003e |\n| emojiMaps      | `object`  | `null`                             | 表情包映射                                     |\n| enableQQ       | `boolean` | `false`                            | 是否启用昵称框自动获取 QQ 昵称和 QQ 头像       |\n| requiredFields | `array`   | `[]`                               | 设置必填项，默认匿名                           |\n\n可在此处查看完整说明：\u003chttps://valine.js.org/configuration.html\u003e\n\n## 💡 我为什么要写这个插件\n\n- 已有的插件已经过时且不再维护了\n- 有意思\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalaxy009%2Fgatsby-plugin-valine-comment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalaxy009%2Fgatsby-plugin-valine-comment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalaxy009%2Fgatsby-plugin-valine-comment/lists"}