[build] 4.5.1

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

View file

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

View file

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

View file

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