1
1
---
2
- import type { Props } from ' @astrojs/starlight/props' ;
3
2
import LanguageSelect from ' @astrojs/starlight/components/LanguageSelect.astro' ;
4
3
import Search from ' @astrojs/starlight/components/Search.astro' ;
5
4
import SiteTitle from ' ./SiteTitle.astro' ;
6
5
import SocialIcons from ' @astrojs/starlight/components/SocialIcons.astro' ;
7
6
import ThemeSelect from ' ./ThemeSelect.astro' ;
8
7
9
- const curLocale = Astro .props .locale ;
10
-
8
+ const curLocale = Astro .locals . starlightRoute .locale ;
9
+ const slug = Astro . locals . starlightRoute . entry . slug ;
11
10
12
11
type Link = {
13
12
title: string ;
@@ -41,10 +40,10 @@ const links: Link[] = [
41
40
42
41
<div class =" header sl-flex" >
43
42
<div class =" full-width sl-flex" >
44
- <SiteTitle { ... Astro . props } />
43
+ <SiteTitle />
45
44
</div >
46
45
<div class =" sl-flex" >
47
- <Search { ... Astro . props } />
46
+ <Search />
48
47
</div >
49
48
<div class =" sl-hidden md:sl-flex right-group" >
50
49
<div class =" desktop" >
@@ -57,10 +56,10 @@ const links: Link[] = [
57
56
}
58
57
</div >
59
58
<div class =" sl-flex social-icons" >
60
- <SocialIcons { ... Astro . props } />
59
+ <SocialIcons />
61
60
</div >
62
- <LanguageSelect { ... Astro . props } />
63
- <ThemeSelect { ... Astro . props } />
61
+ <LanguageSelect />
62
+ <ThemeSelect />
64
63
</div >
65
64
</div >
66
65
@@ -136,7 +135,7 @@ body[data-mobile-menu-expanded] header {
136
135
</style >
137
136
138
137
{
139
- Astro . props . entry . slug === ' ' || Astro . props . locale === Astro . props . entry . slug ?
138
+ slug === ' ' || slug === curLocale ?
140
139
<style >
141
140
.header {
142
141
background - color : transparent ;
0 commit comments