{"id":15209083,"url":"https://github.com/dongyuanxin/vuepress-plugin-comment","last_synced_at":"2025-10-03T01:31:25.901Z","repository":{"id":45454542,"uuid":"190850610","full_name":"dongyuanxin/vuepress-plugin-comment","owner":"dongyuanxin","description":"Comment plugin in vuepress, such as Gitalk, Valine...","archived":true,"fork":false,"pushed_at":"2020-05-13T07:56:41.000Z","size":26,"stargazers_count":39,"open_issues_count":0,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-15T22:40:15.191Z","etag":null,"topics":["blog","ejs","gitalk","valine","vuepress","vuepress-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vuepress-plugin-comment","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dongyuanxin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-08T05:48:05.000Z","updated_at":"2024-11-20T03:19:59.000Z","dependencies_parsed_at":"2022-09-08T20:11:44.035Z","dependency_job_id":null,"html_url":"https://github.com/dongyuanxin/vuepress-plugin-comment","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongyuanxin%2Fvuepress-plugin-comment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongyuanxin%2Fvuepress-plugin-comment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongyuanxin%2Fvuepress-plugin-comment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dongyuanxin%2Fvuepress-plugin-comment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dongyuanxin","download_url":"https://codeload.github.com/dongyuanxin/vuepress-plugin-comment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235059234,"owners_count":18929279,"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":["blog","ejs","gitalk","valine","vuepress","vuepress-plugin"],"created_at":"2024-09-28T07:21:12.129Z","updated_at":"2025-10-03T01:31:20.646Z","avatar_url":"https://github.com/dongyuanxin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vuepress-comment-plugin\n\n[![](https://img.shields.io/badge/online-preview-faad14.svg?style=popout-square)](https://xin-tan.com/)\n[![](https://img.shields.io/npm/dm/vuepress-plugin-comment.svg?style=flat-square)](https://www.npmjs.com/package/vuepress-plugin-comment)\n[![](https://img.shields.io/badge/vuepress-≥v0.9.0-3eaf7c.svg?style=popout-square)](https://vuepress.vuejs.org/)\n![](https://img.shields.io/badge/license-MIT-blue.svg?style=popout-square)\n![version](https://img.shields.io/github/release/dongyuanxin/vuepress-plugin-comment.svg?style=flat-square)\n\n\n\u003e Support popluar comment plugins in Vuepress, sucn as Gitalk, Valine, Disqus.\n\n- [Features](#features)\n- [Usage](#usage)\n  - [Install](#install)\n  - [⚠️Route object properties](#⚠️Route-object-properties)\n  - [Use with Gitalk](#use-in-gitalk)\n  - [Use with Valine](#use-in-valine)\n  - [Hide comment](#how-to-hide-page-comment)\n- [Options detail](#options-detail)\n- [Todo](#todo)\n\n## Features\n\n- Support Gitalk, Valine\n- Dynamic Import\n- Response router change and refresh automatic\n- User can use passage's `$frontmatter`\n\n## Usage\n\n### Install\n\nWith `npm`:\n\n```bash\nnpm install --save vuepress-plugin-comment\n```\n\nWith `yarn`:\n\n```bash\nyarn add vuepress-plugin-comment -D\n```\n\nWith `cnpm`:\n\n```bash\ncnpm i --save vuepress-plugin-comment\n```\n\n\n### ⚠️Route object properties\n\n**Don't use `window` object directly to get route information**.\n\nPlugin has registered correct route information in `frontmatter.to` object and `frontmatter.from` object. Their properties are the same as [vue-router's route object](https://router.vuejs.org/api/#route-object-properties).\n\n### Use in Gitalk\n\nThe `options` is exactly the same as `Gitalk` configuration.\n\n```javascript\nmodule.exports = {\n  plugins: [\n    [\n      'vuepress-plugin-comment',\n      {\n        choosen: 'gitalk', \n        options: {\n          clientID: 'GitHub Application Client ID',\n          clientSecret: 'GitHub Application Client Secret',\n          repo: 'GitHub repo',\n          owner: 'GitHub repo owner',\n          admin: ['GitHub repo owner and collaborators, only these guys can initialize github issues'],\n          distractionFreeMode: false \n        }\n      }\n    ]\n  ]\n}\n```\n\nIf you want to access variables, such as `$frontmatter` and `window`, please use **EJS** syntax.\n\n```javascript\nmodule.exports = {\n  plugins: [\n    [\n      'vuepress-plugin-comment',\n      {\n        choosen: 'gitalk', \n        options: {\n          id: '\u003c%- frontmatter.commentid || frontmatter.permalink %\u003e',\n          title: '「Comment」\u003c%- frontmatter.title %\u003e',\n          body: '\u003c%- frontmatter.title %\u003e：\u003c%-window.location.origin %\u003e\u003c%- frontmatter.to.path || window.location.pathname %\u003e',\n          clientID: 'GitHub Application Client ID',\n          clientSecret: 'GitHub Application Client Secret',\n          repo: 'GitHub repo',\n          owner: 'GitHub repo owner',\n          admin: ['GitHub repo owner and collaborators, only these guys can initialize github issues'],\n          distractionFreeMode: false,\n        }\n      }\n    ]\n  ]\n}\n```\n\n**Note**: Never use callback function in plugin configuration, that will be filtered by vuepress. So I have to support EJS syntax.\n\n### Use in Valine\n\nThe `options` is exactly the same as `Valine` configuration.\n\n```javascript\nmodule.exports = {\n  plugins: [\n    [\n      'vuepress-plugin-comment',\n      {\n        choosen: 'valine', \n        options: {\n          el: '#valine-vuepress-comment',\n          appId: 'Your own appId',\n          appKey: 'Your own appKey'\n        }\n      }\n    ]\n  ]\n}\n```\n\nIf you want to access variables, such as `$frontmatter` and `window`, please use **EJS** syntax.\n\n```javascript\nmodule.exports = {\n  plugins: [\n    [\n      'vuepress-plugin-comment',\n      {\n        choosen: 'valine', \n        options: {\n          el: '#valine-vuepress-comment',\n          appId: 'Your own appId',\n          appKey: 'Your own appKey',\n          path: '\u003c%- frontmatter.commentid || frontmatter.permalink %\u003e'\n        }\n      }\n    ]\n  ]\n}\n```\n\n### How to hide page comment\n\nIf you want to hide comment plugin in specified page, set `$frontmatter.comment` or `$frontmatter.comments` to `false`.\n\nFor example:\n\n```yml\n---\ncomment: false \n# comments: false \n---\n```\n\nComment won't appear in the page of this passage. \n\n## Options Detail\n\n- **choosen** `string`\n\n  **Required**.\n\n- **options** `object`\n\n  **Required**. The options of choosen comment plugin.\n\n- **container** `string`\n\n  **Optional, default as `'main.page'`**. The dom selector that contains choosen comment plugin.\n\n## Todo\n\n- Support Disqus\n- 中文说明\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongyuanxin%2Fvuepress-plugin-comment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdongyuanxin%2Fvuepress-plugin-comment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdongyuanxin%2Fvuepress-plugin-comment/lists"}