All Projects → dongyuanxin → Vuepress Plugin Comment

dongyuanxin / Vuepress Plugin Comment

Comment plugin in vuepress, such as Gitalk, Valine...

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Vuepress Plugin Comment

Hexo Theme Anisina
🎨 A simple responsive , support qiniu image cdn theme for hexo https://haojen.github.io/
Stars: ✭ 746 (+2769.23%)
Mutual labels:  blog, ejs
Hexo Theme Volantis
A Wonderful Theme for Hexo https://volantis.js.org
Stars: ✭ 1,050 (+3938.46%)
Mutual labels:  blog, ejs
Html Webpack Template
a better default template for html-webpack-plugin
Stars: ✭ 818 (+3046.15%)
Mutual labels:  ejs
Gatsby Starter Alchemy
A Gatsby starter with PostCSS powers ✨🔮
Stars: ✭ 23 (-11.54%)
Mutual labels:  blog
Jekyll Theme H2o
🎉 A clean and delicate Jekyll theme. Jekyll博客主题
Stars: ✭ 894 (+3338.46%)
Mutual labels:  blog
Bludit
Simple, Fast, Secure, Flat-File CMS
Stars: ✭ 824 (+3069.23%)
Mutual labels:  blog
Streetturtle.github.io
Blog
Stars: ✭ 19 (-26.92%)
Mutual labels:  blog
Leonids
A simple, fixed sidebar two columns Gatsby.js blog starter.
Stars: ✭ 813 (+3026.92%)
Mutual labels:  blog
Kubeflow Data Science On Steroids
The blog post about Kubeflow, including all materials
Stars: ✭ 25 (-3.85%)
Mutual labels:  blog
Adam
Jeykll theme created for nybles
Stars: ✭ 17 (-34.62%)
Mutual labels:  blog
Techgames
TechGames is a complete gaming news portal to stay on top of everything in the gaming world.
Stars: ✭ 23 (-11.54%)
Mutual labels:  blog
Thenetwork Open
TheNetwork is a blog cum chat app. It's completely built using firebase. Users can post, comment, like and bookmark the blogs, also users can send follow requests to connect with people. Users can create events and also prepare an event roadmap. Pagination for realtime data is also included in chats, blogs and events.
Stars: ✭ 17 (-34.62%)
Mutual labels:  blog
Nodepress
😎 RESTful API service for Blog/CMS, powered by @nestjs
Stars: ✭ 829 (+3088.46%)
Mutual labels:  blog
Brevifolia Gridsome Forestry
A simple starter blog built with Gridsome & Forestry
Stars: ✭ 22 (-15.38%)
Mutual labels:  blog
0x5e.github.io
A peosonal blog
Stars: ✭ 5 (-80.77%)
Mutual labels:  blog
Blogs
📖 全网 100w+ 阅读量的进阶前端技术博客仓库,Vue 源码解析,React 深度实践,TypeScript 进阶艺术,工程化,性能优化实践……
Stars: ✭ 919 (+3434.62%)
Mutual labels:  blog
Vuepress Theme Vdoing
🚀一款简洁高效的VuePress知识管理&博客(blog)主题
Stars: ✭ 809 (+3011.54%)
Mutual labels:  blog
Flyapi
基于SSM layui 开发的多人博客系统,目标在于让每个人都能精准阅读和专注写作。
Stars: ✭ 16 (-38.46%)
Mutual labels:  blog
Piyushmehta.com
Piyush's HomePage https://piyushmehta.tech and
Stars: ✭ 19 (-26.92%)
Mutual labels:  blog
Brucezhaor.github.io
🚧 Bruce Zhao's Tech Blog -- Under Reconstructing ...
Stars: ✭ 25 (-3.85%)
Mutual labels:  blog

Vuepress-comment-plugin

version

Support popluar comment plugins in Vuepress, sucn as Gitalk, Valine, Disqus.

Features

  • Support Gitalk, Valine
  • Dynamic Import
  • Response router change and refresh automatic
  • User can use passage's $frontmatter

Usage

Install

With npm:

npm install --save vuepress-plugin-comment

With yarn:

yarn add vuepress-plugin-comment -D

With cnpm:

cnpm i --save vuepress-plugin-comment

⚠️Route object properties

Don't use window object directly to get route information.

Plugin has registered correct route information in frontmatter.to object and frontmatter.from object. Their properties are the same as vue-router's route object.

Use in Gitalk

The options is exactly the same as Gitalk configuration.

module.exports = {
  plugins: [
    [
      'vuepress-plugin-comment',
      {
        choosen: 'gitalk', 
        options: {
          clientID: 'GitHub Application Client ID',
          clientSecret: 'GitHub Application Client Secret',
          repo: 'GitHub repo',
          owner: 'GitHub repo owner',
          admin: ['GitHub repo owner and collaborators, only these guys can initialize github issues'],
          distractionFreeMode: false 
        }
      }
    ]
  ]
}

If you want to access variables, such as $frontmatter and window, please use EJS syntax.

module.exports = {
  plugins: [
    [
      'vuepress-plugin-comment',
      {
        choosen: 'gitalk', 
        options: {
          id: '<%- frontmatter.commentid || frontmatter.permalink %>',
          title: '「Comment」<%- frontmatter.title %>',
          body: '<%- frontmatter.title %>:<%-window.location.origin %><%- frontmatter.to.path || window.location.pathname %>',
          clientID: 'GitHub Application Client ID',
          clientSecret: 'GitHub Application Client Secret',
          repo: 'GitHub repo',
          owner: 'GitHub repo owner',
          admin: ['GitHub repo owner and collaborators, only these guys can initialize github issues'],
          distractionFreeMode: false,
        }
      }
    ]
  ]
}

Note: Never use callback function in plugin configuration, that will be filtered by vuepress. So I have to support EJS syntax.

Use in Valine

The options is exactly the same as Valine configuration.

module.exports = {
  plugins: [
    [
      'vuepress-plugin-comment',
      {
        choosen: 'valine', 
        options: {
          el: '#valine-vuepress-comment',
          appId: 'Your own appId',
          appKey: 'Your own appKey'
        }
      }
    ]
  ]
}

If you want to access variables, such as $frontmatter and window, please use EJS syntax.

module.exports = {
  plugins: [
    [
      'vuepress-plugin-comment',
      {
        choosen: 'valine', 
        options: {
          el: '#valine-vuepress-comment',
          appId: 'Your own appId',
          appKey: 'Your own appKey',
          path: '<%- frontmatter.commentid || frontmatter.permalink %>'
        }
      }
    ]
  ]
}

How to hide page comment

If you want to hide comment plugin in specified page, set $frontmatter.comment or $frontmatter.comments to false.

For example:

---
comment: false 
# comments: false 
---

Comment won't appear in the page of this passage.

Options Detail

  • choosen string

    Required.

  • options object

    Required. The options of choosen comment plugin.

  • container string

    Optional, default as 'main.page'. The dom selector that contains choosen comment plugin.

Todo

  • Support Disqus
  • 中文说明
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].