Skip to content

Commit 7e62b42

Browse files
committed
Add link to API docs
1 parent 2b98cf7 commit 7e62b42

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed

astro.config.mjs

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export default defineConfig({
2929
label: 'Reference',
3030
autogenerate: { directory: 'reference' },
3131
},
32+
{
33+
label: 'API Reference',
34+
link: '/api/1/docs',
35+
attrs: { target: '_blank' },
36+
}
3237
],
3338
components: {
3439
Hero: './src/components/Hero.astro'

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
"pnpm": {
1414
"onlyBuiltDependencies": [
1515
"sharp"
16-
]
16+
],
17+
"patchedDependencies": {
18+
"@astrojs/starlight": "patches/@astrojs__starlight.patch"
19+
}
1720
},
1821
"dependencies": {
1922
"@astrojs/starlight": "^0.31.0",

patches/@astrojs__starlight.patch

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/components/SidebarSublist.astro b/components/SidebarSublist.astro
2+
index b521ba13ef57d9be188c8775646f9d361c3d3c7c..dae6eb02b8d0553ad5be0a49961652e41eccef77 100644
3+
--- a/components/SidebarSublist.astro
4+
+++ b/components/SidebarSublist.astro
5+
@@ -24,6 +24,9 @@ const { sublist, nested } = Astro.props;
6+
{...entry.attrs}
7+
>
8+
<span>{entry.label}</span>
9+
+ {('target' in entry.attrs) && entry.attrs.target === '_blank' && (
10+
+ <Icon name="external" class="external-icon"/>
11+
+ )}
12+
{entry.badge && (
13+
<Badge
14+
variant={entry.badge.variant}
15+
@@ -59,6 +62,10 @@ const { sublist, nested } = Astro.props;
16+
</ul>
17+
18+
<style>
19+
+ .external-icon {
20+
+ vertical-align: middle;
21+
+ }
22+
+
23+
ul {
24+
--sl-sidebar-item-padding-inline: 0.5rem;
25+
list-style: none;

pnpm-lock.yaml

+7-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)