Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

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
© 2024 Gatsby, Inc.