File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export type Frontmatter = RoadmapFrontmatter &
35
35
TutorialFrontmatter
36
36
37
37
export type LayoutMappingType = typeof layoutMapping
38
+ export type Layout = keyof LayoutMappingType
38
39
39
40
export type Lang =
40
41
| "en"
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import readingTime from "reading-time"
14
14
import remarkGfm from "remark-gfm"
15
15
16
16
import type {
17
+ Layout ,
17
18
LayoutMappingType ,
18
19
NextPageWithLayout ,
19
20
TocNodeType ,
@@ -94,10 +95,7 @@ export const getStaticPaths = (({ locales }) => {
94
95
}
95
96
} ) satisfies GetStaticPaths < Params >
96
97
97
- type Props = Omit <
98
- Parameters < LayoutMappingType [ keyof LayoutMappingType ] > [ 0 ] ,
99
- "children"
100
- > &
98
+ type Props = Omit < Parameters < LayoutMappingType [ Layout ] > [ 0 ] , "children" > &
101
99
SSRConfig & {
102
100
mdxSource : MDXRemoteSerializeResult
103
101
}
@@ -138,7 +136,7 @@ export const getStaticProps = (async (context) => {
138
136
const lastDeployDate = getLastDeployDate ( )
139
137
140
138
// Get corresponding layout
141
- let layout = ( frontmatter . template as keyof LayoutMappingType ) ?? "static"
139
+ let layout = ( frontmatter . template as Layout ) ?? "static"
142
140
143
141
if ( ! frontmatter . template ) {
144
142
if ( params . slug . includes ( "docs" ) ) {
You can’t perform that action at this time.
0 commit comments