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];
2525let previous: Anchor | undefined ;
2626let next: Anchor | undefined ;
2727
28+ const titleForLink = (link : string ) => {
29+ return links .find (([_ , href ]) => href === link )?.at (0 ) || null ;
30+ };
31+
2832// 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 ];
3137
3238// If the user wants auto infered previous/next, find them (if not already set).
3339if (automaticallyInferNextPrevious ) {
@@ -57,7 +63,7 @@ if (automaticallyInferNextPrevious) {
5763 { !! next && (
5864 <Link
5965 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"
6167 >
6268 <span >{ next [0 ]} </span >
6369 <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