@@ -5,7 +5,6 @@ import type { AncestorRevisionPage } from '@/lib/pages';
5
5
import { tcls } from '@/lib/tailwind' ;
6
6
import type { RevisionPageDocument } from '@gitbook/api' ;
7
7
import { Icon } from '@gitbook/icons' ;
8
- import { Fragment } from 'react' ;
9
8
import { PageIcon } from '../PageIcon' ;
10
9
import { StyledLink } from '../primitives' ;
11
10
@@ -56,46 +55,45 @@ export async function PageHeader(props: {
56
55
</ div >
57
56
) : null }
58
57
{ ancestors . length > 0 && (
59
- < nav >
58
+ < nav aria-label = "Breadcrumb" >
60
59
< ol className = { tcls ( 'flex' , 'flex-wrap' , 'items-center' , 'gap-2' , 'text-tint' ) } >
61
60
{ ancestors . map ( ( breadcrumb , index ) => {
62
61
const href = linker . toPathForPage ( {
63
62
pages : revision . pages ,
64
63
page : breadcrumb ,
65
64
} ) ;
66
65
return (
67
- < Fragment key = { breadcrumb . id } >
68
- < li key = { breadcrumb . id } >
69
- < StyledLink
70
- href = { href }
71
- className = { tcls (
72
- 'no-underline' ,
73
- 'hover:underline' ,
74
- 'text-xs' ,
75
- 'tracking-wide' ,
76
- 'font-semibold' ,
77
- 'uppercase' ,
78
- 'flex' ,
79
- 'items-center' ,
80
- 'gap-1.5' ,
81
- 'contrast-more:underline' ,
82
- 'contrast-more:decoration-current'
83
- ) }
84
- >
85
- < PageIcon
86
- page = { breadcrumb }
87
- style = "flex size-4 items-center justify-center text-base leading-none"
88
- />
89
- { breadcrumb . title }
90
- </ StyledLink >
91
- </ li >
66
+ < li key = { breadcrumb . id } className = "flex items-center gap-2" >
67
+ < StyledLink
68
+ href = { href }
69
+ className = { tcls (
70
+ 'no-underline' ,
71
+ 'hover:underline' ,
72
+ 'text-xs' ,
73
+ 'tracking-wide' ,
74
+ 'font-semibold' ,
75
+ 'uppercase' ,
76
+ 'flex' ,
77
+ 'items-center' ,
78
+ 'gap-1.5' ,
79
+ 'contrast-more:underline' ,
80
+ 'contrast-more:decoration-current'
81
+ ) }
82
+ >
83
+ < PageIcon
84
+ page = { breadcrumb }
85
+ style = "flex size-4 items-center justify-center text-base leading-none"
86
+ />
87
+ { breadcrumb . title }
88
+ </ StyledLink >
92
89
{ index !== ancestors . length - 1 && (
93
90
< Icon
91
+ aria-hidden
94
92
icon = "chevron-right"
95
- className = { tcls ( ' size-3' , ' text-tint-subtle' ) }
93
+ className = " size-3 text-tint-subtle"
96
94
/>
97
95
) }
98
- </ Fragment >
96
+ </ li >
99
97
) ;
100
98
} ) }
101
99
</ ol >
0 commit comments