File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
import { languages } from ' ../i18n/ui' ;
3
3
import { base } from " astro:config/client"
4
+
5
+ const pathname = Astro .url .pathname .replace (import .meta .env .BASE_URL , " " );
4
6
---
5
7
<ul class =" language-picker" >
6
8
{ Object .entries (languages ).map (([lang , label ]) => (
7
- <li >
9
+ <li class : list = { [{ active: pathname . startsWith ( ` /${ label } ` ) }] } >
8
10
<a href = { ` ${base }/${lang }/ ` } >{ label } </a >
9
11
</li >
10
12
))}
18
20
display: flex;
19
21
justify-content: flex-end;
20
22
margin-right: 1rem;
23
+
24
+ a {
25
+ text-decoration: none;
26
+ }
27
+
21
28
}
22
29
23
30
li:first-child::after {
24
31
content: '/';
25
32
display: 'inline block'
26
33
margin: 0 8px;
27
34
color: #333;
35
+
36
+ }
37
+
38
+ li.active > a {
39
+ font-weight: bold;
40
+ text-decoration: underline;
28
41
}
29
42
</style >
You can’t perform that action at this time.
0 commit comments