2.0.0 • Published 6 years ago

disqus-snippet v2.0.0

Weekly downloads
28
License
MIT
Repository
github
Last release
6 years ago

NPM version Dependency Status

disqus

Load disqus threads

See in the wild on the American Scenic Byways website - source.

Installation

Install with npm(1):

$ npm install --save disqus-snippet

API

Add #disqus_thread element where you want the thread of discus comments to be rendered.

The following configuration variables are supported:

  • shortname - your disqus forum id - the only mandatory parameter
  • identifier - identifier if different than URL, recommended
  • title - page title if different from head.title
  • url - cannonical page URL, recomended if page URL can have query params
  • developer - set to 1 when loading from localhost

You can pass disqus paramaters using dataset attributes or options object.

On the page:

  <div id="disqus_thread" data-shortname="foo" data-title="Thrursday Foo Discussion"></div>

In the script:

  var disqus = require(`disqus`);
  disqus({
    title: 'Some other title',
    developer: 1
  });

Parameters passed to disqus function overwrite those set up using data- attributes.

If no #disqus_thread element is found we die silently.

License

MIT

2.0.0

6 years ago

1.3.2

7 years ago

1.3.1

7 years ago