File tree 4 files changed +10
-5
lines changed
4 files changed +10
-5
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' nextra ' : patch
3
+ ---
4
+
5
+ add ` frontMatter.sidebarTitle ` only if ` frontMatter.title ` is empty
Original file line number Diff line number Diff line change 1
1
/// <reference types="next" />
2
2
/// <reference types="next/image-types/global" />
3
+ /// <reference types="next/navigation-types/compat/navigation" />
3
4
4
5
// NOTE: This file should not be edited
5
6
// see https://nextjs.org/docs/basic-features/typescript for more information.
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ function extendMeta(
42
42
return {
43
43
...fallback ,
44
44
..._meta ,
45
- display : metadata . display || _meta . display ,
45
+ display : metadata . display || _meta . display || fallback . display ,
46
46
theme
47
47
}
48
48
}
Original file line number Diff line number Diff line change @@ -125,16 +125,15 @@ async function collectFiles({
125
125
// } else {
126
126
const content = await fs . readFile ( filePath , 'utf8' )
127
127
const { data } = grayMatter ( content )
128
- const frontMatter = {
129
- sidebarTitle : pageTitleFromFilename ( name ) ,
130
- ...data
128
+ if ( ! data . title ) {
129
+ data . sidebarTitle = pageTitleFromFilename ( name )
131
130
}
132
131
// }
133
132
134
133
return {
135
134
name,
136
135
route : fileRoute ,
137
- frontMatter
136
+ frontMatter : data
138
137
}
139
138
}
140
139
You can’t perform that action at this time.
0 commit comments