Skip to content

Commit 3b9e462

Browse files
authored
chore: keeping docs inline with dependency breaking changes (#55)
1 parent 28b9802 commit 3b9e462

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

src/components/Header.astro

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
2-
import type { Props } from '@astrojs/starlight/props';
32
import SiteTitle from "@astrojs/starlight/components/SiteTitle.astro";
43
import Search from "@astrojs/starlight/components/Search.astro";
54
import ThemeSelect from "@astrojs/starlight/components/ThemeSelect.astro";
65
import SocialIcons from "@astrojs/starlight/components/SocialIcons.astro";
76
---
87
<div class="header sl-flex">
9-
<SiteTitle {...Astro.props} />
8+
<SiteTitle />
109
<div class="secondary-wrap">
11-
<Search {...Astro.props} />
12-
<SocialIcons {...Astro.props} />
10+
<Search />
11+
<SocialIcons />
1312
<div class="sl-hidden md:sl-flex">
14-
<ThemeSelect {...Astro.props} />
13+
<ThemeSelect />
1514
</div>
1615
</div>
1716
</div>

src/components/PageSidebar.astro

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
import type { Props } from '@astrojs/starlight/props';
32
import Default from '@astrojs/starlight/components/PageSidebar.astro';
43
54
const removeOverview = [
65
'iana',
76
]
8-
const noOverview = removeOverview.includes(Astro.props.slug);
9-
const toc = noOverview && Astro.props.toc !== undefined
10-
? {
11-
...Astro.props.toc,
12-
items: Astro.props.toc?.items.slice(1),
13-
}
14-
: Astro.props.toc;
7+
const { id, toc } = Astro.locals.starlightRoute;
8+
const noOverview = removeOverview.includes(id);
9+
if (noOverview && toc) {
10+
Astro.locals.starlightRoute.toc = {
11+
...toc,
12+
items: toc.items.slice(1),
13+
};
14+
}
1515
---
1616

17-
<Default {...Astro.props} {toc}><slot /></Default>
17+
<Default />

0 commit comments

Comments
 (0)