├── LICENSE ├── README.md └── commento.js /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Nico Domino 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docsify - Commento Plug-in 2 | 3 | Plug-in to allow the use of [commento](https://commento.io) on your [docsify](https://docsify.js.org/#/) pages. 4 | 5 | This will simply append the commento `div` to the end of each of your pages. 6 | 7 | ### 🚧 Install 8 | 9 | 1. Sign-up for the cloud hosted version of Commento / install the self-hosted version 10 | 2. Login to your commento instance and add the domain of your Docsify site 11 | 3. Copy the URL to your `commento.js` file from commento's **universal snippet** 12 | 4. Add it our `commento.js` file from this repo, on line `9` so that 13 | 14 | This: 15 | > ```js 16 | >e.src = "[COMMENTO JS URL]", a.appendTo(a.body, e); 17 | > ``` 18 | 19 | Turns into this: 20 | > ```js 21 | >e.src = "https://commento.mydomain.org/js/commento.js", a.appendTo(a.body, e); 22 | > ``` 23 | 24 | 5. Include our `commento.js` in your Docsify `index.html` like all other plugins 25 | ```html 26 | 27 | ``` 28 | 29 | --- 30 | 31 | 📝 Licence: [`MIT`](https://opensource.org/licenses/MIT) 32 | -------------------------------------------------------------------------------- /commento.js: -------------------------------------------------------------------------------- 1 | $docsify.plugins = [].concat(function(t) { 2 | var a = Docsify.dom; 3 | t.mounted(function(t) { 4 | var n = a.create("div"); 5 | n.id = "commento"; 6 | var i = a.getNode("#main"); 7 | n.style = "width: " + i.clientWidth + "px !important; margin: 0 auto 20px;", a.appendTo(a.find(".content"), n); 8 | var e = a.create("script"); 9 | e.src = "[COMMENTO JS URL]", a.appendTo(a.body, e); 10 | }) 11 | }, $docsify.plugins); 12 | --------------------------------------------------------------------------------