Skip to content

Commit c3f2b9b

Browse files
committed
fix(studio): find index file collection by route path
1 parent 862a8b4 commit c3f2b9b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/runtime/internal/studio/collection.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ export const getCollectionByRoutePath = (routePath: string, collections: Record<
3939
return
4040
}
4141

42+
if (routePath === '/') {
43+
return ['index.yml', 'index.yaml', 'index.md', 'index.json'].some((p) => {
44+
return collection.source.find(source => minimatch(p, source.include))
45+
})
46+
}
47+
4248
const pathWithoutPrefix = routePath.substring(source.prefix.length)
4349

4450
const { fixed } = parseSourceBase(source)

0 commit comments

Comments
 (0)