bump 1.2.0

This commit is contained in:
qingwei.li 2016-12-20 21:20:08 +08:00
commit 73456e6fac
2 changed files with 15 additions and 7 deletions

View file

@ -2518,6 +2518,8 @@ var OPTIONS = {
loadSidebar: null,
loadNavbar: null,
router: false,
homepage: 'README.md',
basePath: '',
auto2top: false
};
var script = document.currentScript || [].slice.call(document.getElementsByTagName('script')).pop();
@ -2540,8 +2542,9 @@ var cacheRoute = null;
var cacheXhr = null;
var mainRender = function (cb) {
var route = getRoute();
var route = OPTIONS.basePath + getRoute();
if (cacheRoute === route) { return cb() }
var wait;
var basePath = cacheRoute = route;
@ -2551,13 +2554,18 @@ var mainRender = function (cb) {
basePath = basePath.match(/(\S*\/)[^\/]+$/)[1];
}
var page;
if (!route) {
page = OPTIONS.homepage || 'README.md';
} else if (/\/$/.test(route)) {
page = route + "README.md";
} else {
page = route + ".md";
}
cacheXhr && cacheXhr.abort && cacheXhr.abort();
// Render markdown file
cacheXhr = load(
(!route || /\/$/.test(route)) ? (route + "README.md") : (route + ".md"),
'GET',
renderLoading);
cacheXhr = load(page, 'GET', renderLoading);
cacheXhr.then(function (result) {
renderArticle(result);
if (OPTIONS.loadSidebar) {

2
lib/docsify.min.js vendored

File diff suppressed because one or more lines are too long