File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -149,20 +149,21 @@ export async function serveProject(
149
149
throw new Error ( `${ target } is not a project` ) ;
150
150
}
151
151
152
- const isDocusaurusMd = (
152
+ const isMdFormat = (
153
+ mdFormat : string ,
153
154
format ?: string | Record < string , unknown > | unknown ,
154
155
) => {
155
156
if ( ! format ) {
156
157
return false ;
157
158
}
158
159
159
160
if ( typeof format === "string" ) {
160
- return format === "docusaurus-md" ;
161
+ return format === mdFormat ;
161
162
} else if ( typeof format === "object" ) {
162
163
const formats = Object . keys ( format ) ;
163
164
if ( formats . length > 0 ) {
164
165
const firstFormat = Object . keys ( format ) [ 0 ] ;
165
- return firstFormat === "docusaurus-md" ;
166
+ return firstFormat === mdFormat ;
166
167
} else {
167
168
return false ;
168
169
}
@@ -174,7 +175,9 @@ export async function serveProject(
174
175
// Default project types can't be served
175
176
const projType = projectType ( project ?. config ?. project ?. [ kProjectType ] ) ;
176
177
if (
177
- projType . type === "default" && ! isDocusaurusMd ( project ?. config ?. format )
178
+ projType . type === "default" &&
179
+ ! isMdFormat ( "docusaurus-md" , project ?. config ?. format ) &&
180
+ ! isMdFormat ( "hugo-md" , project ?. config ?. format )
178
181
) {
179
182
const hasIndex = project . files . input . some ( ( file ) => {
180
183
let relPath = file ;
You can’t perform that action at this time.
0 commit comments