[build] 4.5.1

This commit is contained in:
qingwei.li 2017-11-07 20:03:41 +08:00
parent 2a2ed96eb8
commit c30af850a1
5 changed files with 42 additions and 24 deletions

View File

@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>4.5.0</small>
# docsify <small>4.5.1</small>
> A magical documentation site generator.

View File

@ -2758,10 +2758,13 @@ function parseQuery (query) {
return res
}
function stringifyQuery (obj) {
function stringifyQuery (obj, ignores) {
if ( ignores === void 0 ) ignores = [];
var qs = [];
for (var key in obj) {
if (ignores.indexOf(key) > -1) { continue }
qs.push(
obj[key]
? ((encode(key)) + "=" + (encode(obj[key]))).toLowerCase()
@ -3851,14 +3854,14 @@ function initEvent (vm) {
}
}
function loadNested (path, file, next, vm, first) {
function loadNested (path, qs, file, next, vm, first) {
path = first ? path : path.replace(/\/$/, '');
path = getParentPath(path);
if (!path) { return }
get(vm.router.getFile(path + file))
.then(next, function (_) { return loadNested(path, file, next, vm); });
get(vm.router.getFile(path + file) + qs).then(next, function (_) { return loadNested(path, qs, file, next, vm); }
);
}
function fetchMixin (proto) {
@ -3869,6 +3872,8 @@ function fetchMixin (proto) {
var ref = this.route;
var path = ref.path;
var query = ref.query;
var qs = stringifyQuery(query, ['id']);
var ref$1 = this.config;
var loadNavbar = ref$1.loadNavbar;
var loadSidebar = ref$1.loadSidebar;
@ -3876,7 +3881,7 @@ function fetchMixin (proto) {
// Abort last request
last && last.abort && last.abort();
last = get(this.router.getFile(path), true);
last = get(this.router.getFile(path) + qs, true);
// Current page is html
this.isHTML = /\.html$/g.test(path);
@ -3884,25 +3889,37 @@ function fetchMixin (proto) {
var loadSideAndNav = function () {
if (!loadSidebar) { return cb() }
var fn = function (result) { this$1._renderSidebar(result); cb(); };
var fn = function (result) {
this$1._renderSidebar(result);
cb();
};
// Load sidebar
loadNested(path, loadSidebar, fn, this$1, true);
loadNested(path, qs, loadSidebar, fn, this$1, true);
};
// Load main content
last.then(function (text, opt) {
this$1._renderMain(text, opt);
loadSideAndNav();
},
function (_) {
this$1._renderMain(null);
loadSideAndNav();
});
last.then(
function (text, opt) {
this$1._renderMain(text, opt);
loadSideAndNav();
},
function (_) {
this$1._renderMain(null);
loadSideAndNav();
}
);
// Load nav
loadNavbar &&
loadNested(path, loadNavbar, function (text) { return this$1._renderNav(text); }, this, true);
loadNested(
path,
qs,
loadNavbar,
function (text) { return this$1._renderNav(text); },
this,
true
);
};
proto._fetchCover = function () {
@ -3910,6 +3927,7 @@ function fetchMixin (proto) {
var ref = this.config;
var coverpage = ref.coverpage;
var query = this.route.query;
var root = getParentPath(this.route.path);
var path = this.router.getFile(root + coverpage);
@ -3919,8 +3937,8 @@ function fetchMixin (proto) {
}
this.coverIsHTML = /\.html$/g.test(path);
get(path)
.then(function (text) { return this$1._renderCover(text); });
get(path + stringifyQuery(query, ['id'])).then(function (text) { return this$1._renderCover(text); }
);
};
proto.$fetch = function (cb) {
@ -4036,7 +4054,7 @@ initGlobalAPI();
/**
* Version
*/
Docsify.version = '4.5.0';
Docsify.version = '4.5.1';
/**
* Run Docsify

4
lib/docsify.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -37,5 +37,5 @@
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
}
},
"version": "4.5.0"
"version": "4.5.1"
}

View File

@ -1,6 +1,6 @@
{
"name": "docsify-server-renderer",
"version": "4.5.0",
"version": "4.5.1",
"description": "docsify server renderer",
"author": {
"name": "qingwei-li",