mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
[build] 4.1.14
This commit is contained in:
parent
4bde6d685c
commit
f598e53098
@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
# docsify <small>4.1.13</small>
|
||||
# docsify <small>4.1.14</small>
|
||||
|
||||
> A magical documentation site generator.
|
||||
|
||||
|
||||
@ -3318,7 +3318,7 @@ History.prototype.getBasePath = function getBasePath () {
|
||||
return this.config.basePath
|
||||
};
|
||||
|
||||
History.prototype.getFile = function getFile (path) {
|
||||
History.prototype.getFile = function getFile (path, isRelative) {
|
||||
path = path || this.getCurrentPath();
|
||||
|
||||
var ref = this;
|
||||
@ -3330,6 +3330,10 @@ History.prototype.getFile = function getFile (path) {
|
||||
path = path === '/README.md' ? (config.homepage || path) : path;
|
||||
path = isAbsolutePath(path) ? path : getPath(base, path);
|
||||
|
||||
if (isRelative) {
|
||||
path = path.replace(new RegExp(("^" + base)), '');
|
||||
}
|
||||
|
||||
return path
|
||||
};
|
||||
|
||||
@ -3423,7 +3427,7 @@ var HashHistory = (function (History$$1) {
|
||||
|
||||
return {
|
||||
path: path,
|
||||
file: this.getFile(path),
|
||||
file: this.getFile(path, true),
|
||||
query: parseQuery(query)
|
||||
}
|
||||
};
|
||||
@ -3536,6 +3540,12 @@ function routerMixin (proto) {
|
||||
|
||||
var lastRoute = {};
|
||||
|
||||
function updateRender (vm) {
|
||||
vm.router.normalize();
|
||||
vm.route = vm.router.parse();
|
||||
body.setAttribute('data-page', vm.route.file);
|
||||
}
|
||||
|
||||
function initRouter (vm) {
|
||||
var config = vm.config;
|
||||
var mode = config.routerMode || 'hash';
|
||||
@ -3548,13 +3558,11 @@ function initRouter (vm) {
|
||||
}
|
||||
|
||||
vm.router = router;
|
||||
|
||||
router.normalize();
|
||||
lastRoute = vm.route = router.parse();
|
||||
updateRender(vm);
|
||||
lastRoute = vm.route;
|
||||
|
||||
router.onchange(function (_) {
|
||||
router.normalize();
|
||||
vm.route = router.parse();
|
||||
updateRender(vm);
|
||||
vm._updateRender();
|
||||
|
||||
if (lastRoute.path === vm.route.path) {
|
||||
@ -3750,7 +3758,7 @@ initGlobalAPI();
|
||||
/**
|
||||
* Version
|
||||
*/
|
||||
Docsify.version = '4.1.13';
|
||||
Docsify.version = '4.1.14';
|
||||
|
||||
/**
|
||||
* Run Docsify
|
||||
|
||||
4
lib/docsify.min.js
vendored
4
lib/docsify.min.js
vendored
File diff suppressed because one or more lines are too long
@ -87,8 +87,6 @@ function search (keywords) {
|
||||
var postTitle = post.title && post.title.trim();
|
||||
var postContent = post.body && post.body.trim();
|
||||
var postUrl = post.slug || '';
|
||||
|
||||
postContent = postContent.replace(/!\[.*\]\((.+)\)/g,'');
|
||||
|
||||
if (postTitle && postContent) {
|
||||
keywords.forEach(function (keyword, i) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify-server-renderer",
|
||||
"version": "4.1.13",
|
||||
"version": "4.1.14",
|
||||
"description": "docsify server renderer",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
|
||||
@ -9,7 +9,7 @@ export function routerMixin (proto) {
|
||||
|
||||
let lastRoute = {}
|
||||
|
||||
function updateRender(vm) {
|
||||
function updateRender (vm) {
|
||||
vm.router.normalize()
|
||||
vm.route = vm.router.parse()
|
||||
dom.body.setAttribute('data-page', vm.route.file)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user