1.3.0 • Published 9 years ago
code42day-disqus v1.3.0
disqus
Load disqus threads
See in the wild on the American Scenic Byways website - source.
Installation
Install with npm(1):
$ npm install --save code42day-disqusAPI
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.titleurl- 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