mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
fix(src): get alias
This commit is contained in:
parent
ce99a04f2e
commit
784173e4c8
@ -51,8 +51,6 @@ let cacheRoute = null
|
||||
let cacheXhr = null
|
||||
|
||||
const getAlias = function (route) {
|
||||
route = route.replace(/\/+/, '/')
|
||||
|
||||
if (OPTIONS.alias[route]) {
|
||||
return getAlias(OPTIONS.alias[route])
|
||||
} else {
|
||||
@ -74,10 +72,11 @@ const mainRender = function (cb) {
|
||||
}
|
||||
|
||||
// replace route
|
||||
if (OPTIONS.alias && OPTIONS.alias['/' + route]) {
|
||||
route = getAlias('/' + route)
|
||||
route = '/' + route
|
||||
if (OPTIONS.alias && OPTIONS.alias[route]) {
|
||||
route = getAlias(route)
|
||||
} else {
|
||||
route = OPTIONS.basePath + route
|
||||
route = (OPTIONS.basePath + route).replace(/\/+/, '/')
|
||||
}
|
||||
|
||||
if (!route) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user