mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-12-02 12:10:04 +08:00
21 lines
558 B
JavaScript
21 lines
558 B
JavaScript
(function () {
|
|
function install(hook) {
|
|
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);
|
|
|
|
}());
|