Skip to content

Commit dc536a3

Browse files
committed
fix(index): load file path error
1 parent cc4ffb4 commit dc536a3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/index.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ const mainRender = function (cb) {
7272
}
7373

7474
// replace route
75-
route = '/' + route
76-
if (OPTIONS.alias && OPTIONS.alias[route]) {
77-
route = getAlias(route)
75+
if (OPTIONS.alias && OPTIONS.alias['/' + route]) {
76+
route = getAlias('/' + route)
7877
} else {
7978
route = (OPTIONS.basePath + route).replace(/\/+/, '/')
8079
}
@@ -90,7 +89,7 @@ const mainRender = function (cb) {
9089
}
9190

9291
// Render Cover page
93-
if (OPTIONS.coverpage && page === ('/' + OPTIONS.homepage).replace(/\/+/, '/')) {
92+
if (OPTIONS.coverpage && page === OPTIONS.homepage) {
9493
utils.load(OPTIONS.coverpage).then(render.renderCover)
9594
}
9695

0 commit comments

Comments
 (0)