gatsby-plugin-cusdis

1.1.0 • Public • Published

gatsby-plugin-cusdis

A plugin for adding Cusdis comments to your Gatsby website

Install

$ yarn add gatsby-plugin-cusdis

or

$ npm install -S gatsby-plugin-cusdis

Configure

Add the plugin to your gatsby-config.js file with your Cusdis appId and host

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-cusdis`,
      options: {
        appId: `your-cusdis-app-id`,
        host: `your-cusdis-host`, // not required, default https://cusdis.com
      }
    },
  ]
}

Usage

You can use the plugin as shown in this brief example:

import Cusdis from 'gatsby-plugin-cusdis'

const PostTemplate = () => {
  const cusdisAttrs = {
    pageId: post.id,
    pageUrl: `${config.siteUrl+location.pathname}`,
    pageTitle: post.title,
  }
  return (
    <>
      <h1>{post.title}</h1>
      <Cusdis attrs={cusdisAttrs} />
    </>
  )
}

export default PostTemplate

Package Sidebar

Install

npm i gatsby-plugin-cusdis

Homepage

cusdis.com/

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

4.99 kB

Total Files

6

Last publish

Collaborators

  • ahonn