disqus-snippet
v2.0.0
Published
Loads disqus threads
Downloads
33
Readme
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 parameteridentifier
- identifier if different than URL, recommendedtitle
- page title if different fromhead.title
url
- cannonical page URL, recomended if page URL can have query paramsdeveloper
- set to 1 when loading fromlocalhost
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