All Projects β†’ tterb β†’ gatsby-plugin-disqus

tterb / gatsby-plugin-disqus

Licence: MIT license
πŸ’¬ A plugin for adding Disqus comments to GatsbyJS

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to gatsby-plugin-disqus

gatsby-plugin-dynamic-routes
Creating dynamic routes based on your environment and/or renaming existing routes
Stars: ✭ 14 (-65%)
Mutual labels:  gatsby, gatsbyjs, gatsby-plugin
gatsby-source-stripe
Gatsby source plugin for building websites using Stripe as a data source
Stars: ✭ 71 (+77.5%)
Mutual labels:  gatsby, gatsbyjs, gatsby-plugin
gatsby-attila-theme-ghost
A Gatsby theme plugin for creating blogs from headless Ghost CMS.
Stars: ✭ 16 (-60%)
Mutual labels:  gatsby, gatsbyjs, gatsby-plugin
gatsby-graphcms-example
Example of Gatsby source plugin for GraphCMS
Stars: ✭ 32 (-20%)
Mutual labels:  gatsby, gatsbyjs, gatsby-plugin
gatsby-plugin-lunr
Gatsby plugin for full text search implementation based on lunr client-side index. Supports multilanguage search.
Stars: ✭ 69 (+72.5%)
Mutual labels:  gatsby, gatsbyjs, gatsby-plugin
gatsby-theme-deck-n-blog
Create a deck (with mdx-deck) and a blog post from the same MDX
Stars: ✭ 17 (-57.5%)
Mutual labels:  gatsby, gatsbyjs, gatsby-plugin
gatsby-simple-blog
an easily configurable gatsby-starter-blog with overreacted looking and tags, breadcrumbs, disqus, i18n, eslint, algolia supported
Stars: ✭ 48 (+20%)
Mutual labels:  gatsby, disqus, gatsbyjs
gatsby-plugin-prettier-build
prettify gatsby build output
Stars: ✭ 30 (-25%)
Mutual labels:  gatsby, gatsbyjs, gatsby-plugin
Gatsby Advanced Starter
A high performance skeleton starter for GatsbyJS that focuses on SEO/Social features/development environment.
Stars: ✭ 1,224 (+2960%)
Mutual labels:  gatsby, disqus, gatsbyjs
gatsby-plugin-apollo-client
πŸ“‘Inject a Shopify Apollo Client into the browser.
Stars: ✭ 20 (-50%)
Mutual labels:  gatsby, gatsbyjs, gatsby-plugin
gatsby-wiki
Creating a Knowledgbase using Gatsby.js and React.js (see final product ->
Stars: ✭ 32 (-20%)
Mutual labels:  gatsby, gatsbyjs
gatsby-source-directus7
Source plugin for pulling data into GatsbyJS from Directus CMS (https://directus.io)
Stars: ✭ 17 (-57.5%)
Mutual labels:  gatsby, gatsby-plugin
gatsby-source-behance
Gatsby source plugin for loading information from Behance
Stars: ✭ 17 (-57.5%)
Mutual labels:  gatsby, gatsby-plugin
gatsby-plugin-tailwindcss
Plug Tailwind CSS to your Gatsby website
Stars: ✭ 46 (+15%)
Mutual labels:  gatsby, gatsby-plugin
gatsby-portfolio
Portfolio / Personal Website - Built with Gatsby.js and Published at konstantin.digital
Stars: ✭ 23 (-42.5%)
Mutual labels:  gatsby, gatsbyjs
Discord Fork
An open source Discord Bot List made with GatsbyJS
Stars: ✭ 60 (+50%)
Mutual labels:  gatsby, gatsbyjs
gatsby-starter-kit
A set of starters for Gatsby.js
Stars: ✭ 99 (+147.5%)
Mutual labels:  gatsby, gatsbyjs
react-hooks-gatsby
Learn how to use React Hooks, and how they work with Gatsby. Watch the livestream:
Stars: ✭ 18 (-55%)
Mutual labels:  gatsby, gatsbyjs
gatsby-starter-breeze
A Gatsby starter for graceful blogging in Chinese.
Stars: ✭ 44 (+10%)
Mutual labels:  gatsby, gatsbyjs
substrate-docs
Substrate Developer Hub. Substrate is powered by best in class cryptographic research and comes with peer to peer networking, consensus mechanisms, and much more.
Stars: ✭ 63 (+57.5%)
Mutual labels:  gatsby, gatsbyjs

Gatsby Plugin Disqus

A plugin that simplifies adding Disqus comments to your Gatsby website

Description

The goal of this plugin is to allow users to bring their content to life and cultivate engaged communities by integrating Disqus comments into their blazing-fast Gatsby websites. After struggling to integrate different Disqus components into my Gatsby site, creating an easily-configured plugin for the Gatsby ecosystem felt like a no-brainer.

Install

$ yarn add gatsby-plugin-disqus

or

$ npm install -S gatsby-plugin-disqus

Configure

Add the plugin to your gatsby-config.js file with your Disqus shortname

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-disqus`,
      options: {
        shortname: `your-disqus-shortname`
      }
    },
  ]
}

Usage

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

import { Disqus, CommentCount } from 'gatsby-plugin-disqus'

const PostTemplate = () => {
  let disqusConfig = {
    url: `${config.siteUrl+location.pathname}`,
    identifier: post.id,
    title: post.title,
  }
  return (
    <>
      <h1>{post.title}</h1>
      <CommentCount config={disqusConfig} placeholder={'...'} />
      /* Post Contents */
      <Disqus config={disqusConfig} />
    </>
  )
}

export default PostTemplate

While providing a url, identifier, and title are optional, these attributes are recommended as it will prevent threads from being lost in the case that the domain changes or the post is renamed. Additional information on all available parameters can be found on the wiki.

Note: When running your site locally, you should pass the production URL to the config.url because this is the URL that Disqus will associate with the shortname and identifier to identify the correct comment thread.

Contributing

  1. Make sure you have yarn installed.
  2. Create a new folder for your yarn workspace. mkdir gatsby-disqus-workspace
  3. Inside your workspace folder, clone this repo.
  4. cd into gatsby-disqus-workspace/gatsby-plugin-disqus/ and run yarn && yarn watch. Leave this terminal window open.
  5. Add a gatsby site that uses gatsby-plugin-disqus into your workspace folder for testing purposes.
  6. In your workspace folder create a package.json and add the following:
{
	"private": true,
	"workspaces": [
		"your-example-test-site",
		"gatsby-plugin-disqus/lib"
	]
}
  1. In a new terminal window, navigate to your workspace folder and run yarn && yarn workspace <example-site> run develop.

If you have unanswered questions or would like help with enhancing or debugging the plugin, feel free create an issue or submit a pull request.

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].