Skip to content

Commit 2e1a736

Browse files
committed
[build] 4.5.0
1 parent 7510f75 commit 2e1a736

File tree

7 files changed

+59
-5
lines changed

7 files changed

+59
-5
lines changed

docs/_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](_media/icon.svg)
22

3-
# docsify <small>4.4.1</small>
3+
# docsify <small>4.5.0</small>
44

55
> A magical documentation site generator.
66

lib/docsify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4036,7 +4036,7 @@ initGlobalAPI();
40364036
/**
40374037
* Version
40384038
*/
4039-
Docsify.version = '4.4.1';
4039+
Docsify.version = '4.5.0';
40404040

40414041
/**
40424042
* Run Docsify

lib/docsify.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/plugins/disqus.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
(function () {
2+
'use strict';
3+
4+
location.href = location.href.replace('/-/', '/#/');
5+
6+
function install (hook, vm) {
7+
var dom = Docsify.dom;
8+
var disqus = vm.config.disqus;
9+
if (!disqus) {
10+
throw Error('$docsify.disqus is required')
11+
}
12+
13+
hook.init(function (_) {
14+
var script = dom.create('script');
15+
16+
script.async = true;
17+
script.src = "https://" + disqus + ".disqus.com/embed.js";
18+
script.setAttribute('data-timestamp', +new Date());
19+
dom.appendTo(dom.body, script);
20+
});
21+
22+
hook.mounted(function (_) {
23+
var div = dom.create('div');
24+
div.id = 'disqus_thread';
25+
var main = dom.getNode('#main');
26+
div.style = "width: " + (main.clientWidth) + "px; margin: 0 auto 20px;";
27+
dom.appendTo(dom.find('.content'), div);
28+
29+
// eslint-disable-next-line
30+
window.disqus_config = function() {
31+
this.page.url = location.origin + '/-' + vm.route.path;
32+
this.page.identifier = vm.route.path;
33+
this.page.title = document.title;
34+
};
35+
});
36+
37+
hook.doneEach(function (_) {
38+
if (typeof window.DISQUS !== 'undefined') {
39+
window.DISQUS.reset({
40+
reload: true,
41+
config: function () {
42+
this.page.url = location.origin + '/-' + vm.route.path;
43+
this.page.identifier = vm.route.path;
44+
this.page.title = document.title;
45+
}
46+
});
47+
}
48+
});
49+
}
50+
51+
$docsify.plugins = [].concat(install, $docsify.plugins);
52+
53+
}());

lib/plugins/disqus.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/docsify-server-renderer/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/docsify-server-renderer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docsify-server-renderer",
3-
"version": "4.4.1",
3+
"version": "4.5.0",
44
"description": "docsify server renderer",
55
"author": {
66
"name": "qingwei-li",

0 commit comments

Comments
 (0)