Skip to content

Commit 1335baa

Browse files
committed
[build] 4.6.4
1 parent 123c516 commit 1335baa

File tree

5 files changed

+43
-17
lines changed

5 files changed

+43
-17
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.6.3</small>
3+
# docsify <small>4.6.4</small>
44

55
> A magical documentation site generator.
66

lib/docsify.js

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3747,7 +3747,7 @@ function renderMixin (proto) {
37473747
callHook(this$1, 'afterEach', html, function (text) { return renderMain.call(this$1, text); });
37483748
};
37493749
if (this$1.isHTML) {
3750-
html = this$1.result;
3750+
html = this$1.result = text;
37513751
callback();
37523752
next();
37533753
} else {
@@ -4177,14 +4177,39 @@ function fetchMixin (proto) {
41774177
var loadNavbar = ref$1.loadNavbar;
41784178
var loadSidebar = ref$1.loadSidebar;
41794179
var requestHeaders = ref$1.requestHeaders;
4180-
4180+
var fallbackLanguages = ref$1.fallbackLanguages;
41814181
// Abort last request
41824182
last && last.abort && last.abort();
41834183

4184-
last = get(this.router.getFile(path) + qs, true, requestHeaders);
4184+
var file = this.router.getFile(path);
4185+
last = get(file + qs, true, requestHeaders);
41854186

41864187
// Current page is html
4187-
this.isHTML = /\.html$/g.test(path);
4188+
this.isHTML = /\.html$/g.test(file);
4189+
4190+
var getFallBackPage = function (file) {
4191+
if (!fallbackLanguages) {
4192+
return false
4193+
}
4194+
4195+
var local = file.split('/')[1];
4196+
4197+
if (fallbackLanguages.indexOf(local) === -1) {
4198+
return false
4199+
}
4200+
4201+
file = file.replace(new RegExp(("^/" + local)), '');
4202+
4203+
return get(file + qs, true, requestHeaders)
4204+
.then(
4205+
function (text, opt) {
4206+
this$1._renderMain(text, opt, loadSideAndNav);
4207+
},
4208+
function (_) {
4209+
return this$1._renderMain(null, {}, loadSideAndNav)
4210+
}
4211+
)
4212+
};
41884213

41894214
var loadSideAndNav = function () {
41904215
if (!loadSidebar) { return cb() }
@@ -4199,14 +4224,15 @@ function fetchMixin (proto) {
41994224
};
42004225

42014226
// Load main content
4202-
last.then(
4203-
function (text, opt) {
4204-
this$1._renderMain(text, opt, loadSideAndNav);
4205-
},
4206-
function (_) {
4207-
this$1._renderMain(null, {}, loadSideAndNav);
4208-
}
4209-
);
4227+
last
4228+
.then(
4229+
function (text, opt) {
4230+
this$1._renderMain(text, opt, loadSideAndNav);
4231+
},
4232+
function (_) {
4233+
return getFallBackPage(file) || this$1._renderMain(null, {}, loadSideAndNav)
4234+
}
4235+
);
42104236

42114237
// Load nav
42124238
loadNavbar &&
@@ -4379,7 +4405,7 @@ initGlobalAPI();
43794405
/**
43804406
* Version
43814407
*/
4382-
Docsify.version = '4.6.3';
4408+
Docsify.version = '4.6.4';
43834409

43844410
/**
43854411
* 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.

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.6.3",
3+
"version": "4.6.4",
44
"description": "docsify server renderer",
55
"author": {
66
"name": "qingwei-li",

0 commit comments

Comments
 (0)