fix typos in generator

This commit is contained in:
Pooya Parsa 2018-03-16 22:51:55 +03:30
parent 6234ae84c0
commit efd7c1b4d1
1 changed files with 5 additions and 6 deletions

View File

@ -247,18 +247,17 @@ export default class Generator {
} }
} }
let path let _path
if (this.options.generate.subFolders) { if (this.options.generate.subFolders) {
path = path.join(route, path.sep, 'index.html') // /about -> /about/index.html _path = path.join(route, path.sep, 'index.html') // /about -> /about/index.html
path = path === '/404/index.html' ? '/404.html' : path // /404 -> /404.html _path = _path === '/404/index.html' ? '/404.html' : _path // /404 -> /404.html
} else { } else {
path = _path = route.length > 1 ? path.join(path.sep, route + '.html') : path.join(path.sep, 'index.html')
route.length > 1 ? path.join(path.sep, route + '.html') : path.join(path.sep, 'index.html')
} }
// Call hook to let user update the path & html // Call hook to let user update the path & html
const page = { route, path, html } const page = { route, path: _path, html }
await this.nuxt.callHook('generate:page', page) await this.nuxt.callHook('generate:page', page)
page.path = path.join(this.distPath, page.path) page.path = path.join(this.distPath, page.path)