Skip to content

Commit e53908e

Browse files
committed
fix: keep dataPiece with key 'main' at the front (before demos)
1 parent c319937 commit e53908e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/theme-doc/src/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ export function createTheme(
9393
.sort((a, b) => {
9494
// sort by (order, key)
9595
if (a.order !== b.order) return a.order - b.order
96+
// keep dataPiece with key 'main' at the front (before demos)
97+
if (a.key === 'main') return -1
98+
if (b.key === 'main') return 1
9699
return a.key.localeCompare(b.key)
97100
})
98101
.map(({ result }) => result)

0 commit comments

Comments
 (0)