@@ -124,14 +124,15 @@ module.exports = async function loadTheme (ctx) {
124
124
125
125
const layoutComponentMap = layoutDirs
126
126
. map (
127
- layourDir => readdirSync ( layourDir )
127
+ layoutDir => readdirSync ( layoutDir )
128
128
. filter ( filename => filename . endsWith ( '.vue' ) )
129
129
. map ( filename => {
130
130
const componentName = getComponentName ( filename )
131
131
return {
132
- filename, componentName,
132
+ filename,
133
+ componentName,
133
134
isInternal : isInternal ( componentName ) ,
134
- path : path . resolve ( layourDir , filename )
135
+ path : path . resolve ( layoutDir , filename )
135
136
}
136
137
} )
137
138
)
@@ -148,14 +149,15 @@ module.exports = async function loadTheme (ctx) {
148
149
149
150
const { Layout = { } , NotFound = { } } = layoutComponentMap
150
151
151
- if ( ! Layout && ! fs . existsSync ( Layout . path ) ) {
152
+ // layout component does not exist.
153
+ if ( ! Layout || ! fs . existsSync ( Layout . path ) ) {
152
154
throw new Error ( `[vuepress] Cannot resolve Layout.vue file in \n ${ Layout . path } ` )
153
155
}
154
156
155
157
// use default 404 component.
156
158
if ( ! NotFound || ! fs . existsSync ( NotFound . path ) ) {
157
159
layoutComponentMap . NotFound = {
158
- filename : 'Layout .vue' ,
160
+ filename : 'NotFound .vue' ,
159
161
componentName : 'NotFound' ,
160
162
path : path . resolve ( __dirname , '../app/components/NotFound.vue' ) ,
161
163
isInternal : true
0 commit comments