mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Add subFolders option for generate
This commit is contained in:
parent
e97bb1d099
commit
59ad478037
@ -179,8 +179,15 @@ export default class Generator {
|
||||
}
|
||||
}
|
||||
|
||||
let path = join(route, sep, 'index.html') // /about -> /about/index.html
|
||||
path = (path === '/404/index.html') ? '/404.html' : path // /404 -> /404.html
|
||||
let path
|
||||
|
||||
if (this.options.generate.subFolders) {
|
||||
path = join(route, sep, 'index.html') // /about -> /about/index.html
|
||||
path = path === '/404/index.html' ? '/404.html' : path // /404 -> /404.html
|
||||
} else {
|
||||
path =
|
||||
route.length > 1 ? join(sep, route + '.html') : join(sep, 'index.html')
|
||||
}
|
||||
|
||||
// Call hook to let user update the path & html
|
||||
const page = { route, path, html }
|
||||
|
@ -208,6 +208,7 @@ Options.defaults = {
|
||||
routes: [],
|
||||
concurrency: 500,
|
||||
interval: 0,
|
||||
subFolders: true,
|
||||
minify: {
|
||||
collapseBooleanAttributes: true,
|
||||
collapseWhitespace: false,
|
||||
|
Loading…
Reference in New Issue
Block a user