https://github.com/pirxpilot/disqus-snippet
Load disqus threads
https://github.com/pirxpilot/disqus-snippet
Last synced: 10 months ago
JSON representation
Load disqus threads
- Host: GitHub
- URL: https://github.com/pirxpilot/disqus-snippet
- Owner: pirxpilot
- License: mit
- Created: 2013-10-11T14:55:45.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2017-12-18T03:29:20.000Z (over 8 years ago)
- Last Synced: 2025-08-16T23:47:38.038Z (11 months ago)
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
- License: License.txt
Awesome Lists containing this project
README
[![NPM version][npm-image]][npm-url]
[![Dependency Status][gemnasium-image]][gemnasium-url]
# disqus
Load [disqus] threads
See in the wild on the [American Scenic Byways][byways.site] website - _[source][byways.src]_.
## Installation
Install with [npm(1)](https://www.npmjs.com):
$ 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][disqus.config] 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:
```HTML
```
In the script:
```javascript
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
[disqus]: http://disqus.com
[disqus.config]: http://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables
[byways.site]: http://scenicbyways.info/byway/2286.html
[byways.src]: https://github.com/pirxpilot/byways
[npm-image]: https://img.shields.io/npm/v/disqus-snippet.svg
[npm-url]: https://npmjs.org/package/disqus-snippet
[gemnasium-image]: https://img.shields.io/gemnasium/pirxpilot/disqus-snippet.svg
[gemnasium-url]: https://gemnasium.com/pirxpilot/disqus-snippet