[build] 4.5.3
This commit is contained in:
parent
9208e64939
commit
b77f46a8e3
7 changed files with 28 additions and 5 deletions
22
lib/plugins/gitalk.js
Normal file
22
lib/plugins/gitalk.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
function install (hook, vm) {
|
||||
var dom = Docsify.dom;
|
||||
|
||||
hook.mounted(function (_) {
|
||||
var div = dom.create('div');
|
||||
div.id = 'gitalk-container';
|
||||
var main = dom.getNode('#main');
|
||||
div.style = "width: " + (main.clientWidth) + "px; margin: 0 auto 20px;";
|
||||
dom.appendTo(dom.find('.content'), div);
|
||||
var script = dom.create('script');
|
||||
var content = "gitalk.render('gitalk-container')";
|
||||
script.textContent = content;
|
||||
dom.appendTo(dom.body, script);
|
||||
});
|
||||
}
|
||||
|
||||
$docsify.plugins = [].concat(install, $docsify.plugins);
|
||||
|
||||
}());
|
||||
Loading…
Add table
Add a link
Reference in a new issue