File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
website-v3/src/components Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,15 @@ type Anchor = [string, string];
25
25
let previous: Anchor | undefined ;
26
26
let next: Anchor | undefined ;
27
27
28
+ const titleForLink = (link : string ) => {
29
+ return links .find (([_ , href ]) => href === link )?.at (0 ) || null ;
30
+ };
31
+
28
32
// If the user has specified a previous or next page, use that.
29
- if (frontmatter .previous ) previous = [frontmatter .previous , frontmatter .previousTitle ];
30
- if (frontmatter .next ) next = [frontmatter .next , frontmatter .nextTitle ];
33
+ if (frontmatter .previous )
34
+ previous = [frontmatter .previousTitle || titleForLink (frontmatter .previous ) || ' ' , frontmatter .previous ];
35
+ if (frontmatter .next )
36
+ next = [frontmatter .nextTitle || titleForLink (frontmatter .next ) || ' ' , frontmatter .next ];
31
37
32
38
// If the user wants auto infered previous/next, find them (if not already set).
33
39
if (automaticallyInferNextPrevious ) {
@@ -57,7 +63,7 @@ if (automaticallyInferNextPrevious) {
57
63
{ !! next && (
58
64
<Link
59
65
href = { next [1 ]}
60
- className = " group inline-flex items-center gap-2 opacity-75 transition hover:opacity-100 text-right "
66
+ className = " group inline-flex items-center gap-2 text-right opacity-75 transition hover:opacity-100"
61
67
>
62
68
<span >{ next [0 ]} </span >
63
69
<span class = " group-hover:text-docs-theme h-4 w-4 flex-shrink-0 transition" >
You can’t perform that action at this time.
0 commit comments