Skip to content

Commit

Permalink
feat($core): decode page path for better readablility (#1438)
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma authored and ulivz committed Mar 13, 2019
1 parent f516cb4 commit 93b2ca1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/@vuepress/core/lib/node/build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ module.exports = class Build extends EventEmitter {
*/

async renderPage (page) {
const pagePath = page.path
const pagePath = decodeURIComponent(page.path)
readline.clearLine(process.stdout, 0)
readline.cursorTo(process.stdout, 0)
process.stdout.write(`Rendering page: ${pagePath}`)
Expand All @@ -143,7 +143,7 @@ module.exports = class Build extends EventEmitter {
const pageMeta = renderPageMeta(meta)

const context = {
url: pagePath,
url: page.path,
userHeadTags: this.userHeadTags,
pageMeta,
title: 'VuePress',
Expand All @@ -158,7 +158,7 @@ module.exports = class Build extends EventEmitter {
console.error(logger.error(chalk.red(`Error rendering ${pagePath}:`), false))
throw e
}
const filename = decodeURIComponent(pagePath.replace(/\/$/, '/index.html').replace(/^\//, ''))
const filename = pagePath.replace(/\/$/, '/index.html').replace(/^\//, '')
const filePath = path.resolve(this.outDir, filename)
await fs.ensureDir(path.dirname(filePath))
await fs.writeFile(filePath, html)
Expand Down

0 comments on commit 93b2ca1

Please sign in to comment.