File tree 3 files changed +17
-3
lines changed
3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ export function usePrevNext() {
31
31
? frontmatter . value . prev
32
32
: typeof frontmatter . value . prev === 'object'
33
33
? frontmatter . value . prev . text
34
- : undefined ) ?? candidates [ index - 1 ] ?. text ,
34
+ : undefined ) ??
35
+ candidates [ index - 1 ] ?. docFooterText ??
36
+ candidates [ index - 1 ] ?. text ,
35
37
link :
36
38
( typeof frontmatter . value . prev === 'object'
37
39
? frontmatter . value . prev . link
@@ -45,7 +47,9 @@ export function usePrevNext() {
45
47
? frontmatter . value . next
46
48
: typeof frontmatter . value . next === 'object'
47
49
? frontmatter . value . next . text
48
- : undefined ) ?? candidates [ index + 1 ] ?. text ,
50
+ : undefined ) ??
51
+ candidates [ index + 1 ] ?. docFooterText ??
52
+ candidates [ index + 1 ] ?. text ,
49
53
link :
50
54
( typeof frontmatter . value . next === 'object'
51
55
? frontmatter . value . next . link
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { isActive } from '../../shared'
5
5
export interface SidebarLink {
6
6
text : string
7
7
link : string
8
+ docFooterText ?: string
8
9
}
9
10
10
11
type SidebarItem = DefaultTheme . SidebarItem
@@ -71,7 +72,11 @@ export function getFlatSideBarLinks(sidebar: SidebarItem[]): SidebarLink[] {
71
72
function recursivelyExtractLinks ( items : SidebarItem [ ] ) {
72
73
for ( const item of items ) {
73
74
if ( item . text && item . link ) {
74
- links . push ( { text : item . text , link : item . link } )
75
+ links . push ( {
76
+ text : item . text ,
77
+ link : item . link ,
78
+ docFooterText : item . docFooterText
79
+ } )
75
80
}
76
81
77
82
if ( item . items ) {
Original file line number Diff line number Diff line change @@ -229,6 +229,11 @@ export namespace DefaultTheme {
229
229
* Base path for the children items.
230
230
*/
231
231
base ?: string
232
+
233
+ /**
234
+ * Customize text that appears on the footer of previous/next page.
235
+ */
236
+ docFooterText ?: string
232
237
}
233
238
234
239
/**
You can’t perform that action at this time.
0 commit comments