mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +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
|
let path
|
||||||
path = (path === '/404/index.html') ? '/404.html' : path // /404 -> /404.html
|
|
||||||
|
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
|
// Call hook to let user update the path & html
|
||||||
const page = { route, path, html }
|
const page = { route, path, html }
|
||||||
|
@ -208,6 +208,7 @@ Options.defaults = {
|
|||||||
routes: [],
|
routes: [],
|
||||||
concurrency: 500,
|
concurrency: 500,
|
||||||
interval: 0,
|
interval: 0,
|
||||||
|
subFolders: true,
|
||||||
minify: {
|
minify: {
|
||||||
collapseBooleanAttributes: true,
|
collapseBooleanAttributes: true,
|
||||||
collapseWhitespace: false,
|
collapseWhitespace: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user