@astrojs/starlight 0.21.5 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -0
- package/__e2e__/fixtures/basics/astro.config.mjs +10 -0
- package/__e2e__/fixtures/basics/node_modules/.bin/astro +17 -0
- package/__e2e__/fixtures/basics/package.json +9 -0
- package/__e2e__/fixtures/basics/src/content/config.ts +6 -0
- package/__e2e__/fixtures/basics/src/content/docs/tabs-variable-height.mdx +151 -0
- package/__e2e__/fixtures/basics/src/content/docs/tabs.mdx +37 -0
- package/__e2e__/fixtures/basics/src/env.d.ts +2 -0
- package/__e2e__/tabs.test.ts +122 -0
- package/__e2e__/test-utils.ts +53 -0
- package/components/ContentNotice.astro +31 -0
- package/components/DraftContentNotice.astro +8 -0
- package/components/FallbackContentNotice.astro +2 -21
- package/components/Head.astro +3 -3
- package/components/Icons.ts +9 -0
- package/components/Page.astro +2 -0
- package/components/SiteTitle.astro +2 -1
- package/components/ThemeSelect.astro +36 -48
- package/global.d.ts +1 -1
- package/index.astro +1 -1
- package/integrations/expressive-code/hast.d.ts +5 -0
- package/integrations/expressive-code/hast.mjs +9 -0
- package/package.json +13 -3
- package/playwright.config.ts +15 -0
- package/schema.ts +16 -3
- package/schemas/components.ts +9 -0
- package/schemas/i18n.ts +18 -5
- package/schemas/site-title.ts +22 -0
- package/schemas/social.ts +2 -0
- package/style/props.css +1 -1
- package/translations/ar.json +1 -0
- package/translations/cs.json +1 -0
- package/translations/da.json +1 -0
- package/translations/de.json +1 -0
- package/translations/en.json +1 -0
- package/translations/es.json +1 -0
- package/translations/fa.json +8 -7
- package/translations/fr.json +1 -0
- package/translations/gl.json +1 -0
- package/translations/he.json +1 -0
- package/translations/hi.json +1 -0
- package/translations/id.json +1 -0
- package/translations/it.json +1 -0
- package/translations/ja.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/nb.json +1 -0
- package/translations/nl.json +1 -0
- package/translations/pl.json +1 -0
- package/translations/pt.json +1 -0
- package/translations/ro.json +1 -0
- package/translations/ru.json +5 -1
- package/translations/sv.json +1 -0
- package/translations/tr.json +1 -0
- package/translations/uk.json +1 -0
- package/translations/vi.json +1 -0
- package/translations/zh-CN.json +1 -0
- package/translations/zh-TW.json +1 -0
- package/user-components/Tabs.astro +44 -3
- package/utils/createTranslationSystem.ts +10 -8
- package/utils/route-data.ts +14 -1
- package/utils/routing.ts +9 -6
- package/utils/starlight-page.ts +2 -1
- package/utils/translations.ts +6 -2
- package/utils/user-config.ts +21 -12
- package/virtual.d.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# @astrojs/starlight
|
|
2
2
|
|
|
3
|
+
## 0.22.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1c0fc384`](https://github.com/withastro/starlight/commit/1c0fc3849771713d5a3e7a572bdbf1483ae5551b) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes an issue where the `siteTitle` property would not be set when using the `<StarlightPage />` component.
|
|
8
|
+
|
|
9
|
+
## 0.22.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#640](https://github.com/withastro/starlight/pull/640) [`7dc503ea`](https://github.com/withastro/starlight/commit/7dc503ea7993123a4aeff453d08de41cac887353) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds support for syncing multiple sets of tabs on the same page.
|
|
14
|
+
|
|
15
|
+
- [#1620](https://github.com/withastro/starlight/pull/1620) [`ca0678ca`](https://github.com/withastro/starlight/commit/ca0678ca556d739bda9648edc1b79c764fdea851) Thanks [@emjio](https://github.com/emjio)! - Adds support for translating the site title
|
|
16
|
+
|
|
17
|
+
⚠️ **Potentially breaking change:** The shape of the `title` field on Starlight’s internal config object has changed. This used to be a string, but is now an object.
|
|
18
|
+
|
|
19
|
+
If you are relying on `config.title` (for example in a custom `<SiteTitle>` or `<Head>` component), you will need to update your code. We recommend using the new [`siteTitle` prop](https://starlight.astro.build/reference/overrides/#sitetitle) available to component overrides:
|
|
20
|
+
|
|
21
|
+
```astro
|
|
22
|
+
---
|
|
23
|
+
import type { Props } from '@astrojs/starlight/props';
|
|
24
|
+
|
|
25
|
+
// The site title for this page’s language:
|
|
26
|
+
const { siteTitle } = Astro.props;
|
|
27
|
+
---
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- [#1613](https://github.com/withastro/starlight/pull/1613) [`61493e55`](https://github.com/withastro/starlight/commit/61493e55f1a80362af13f98d665018376e987439) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds new `draft` frontmatter option to exclude a page from production builds.
|
|
31
|
+
|
|
32
|
+
- [#640](https://github.com/withastro/starlight/pull/640) [`7dc503ea`](https://github.com/withastro/starlight/commit/7dc503ea7993123a4aeff453d08de41cac887353) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Updates the default `line-height` from `1.8` to `1.75`. This change avoids having a line height with a fractional part which can cause scripts accessing dimensions involving the line height to get an inconsistent rounded value in various browsers.
|
|
33
|
+
|
|
34
|
+
If you want to preserve the previous `line-height`, you can add the following custom CSS to your site:
|
|
35
|
+
|
|
36
|
+
```css
|
|
37
|
+
:root {
|
|
38
|
+
--sl-line-height: 1.8;
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
- [#1720](https://github.com/withastro/starlight/pull/1720) [`749ddf85`](https://github.com/withastro/starlight/commit/749ddf85a21d8ed1bfedbe60dee676cdd8784e96) Thanks [@jacobdalamb](https://github.com/jacobdalamb)! - Updates `astro-expressive-code` dependency to the latest minor release (0.35) and exposes a new `@astrojs/starlight/expressive-code/hast` module for users who need to use Expressive Code’s version of `hast`.
|
|
43
|
+
|
|
44
|
+
This includes a potentially breaking change if you use custom Expressive Code plugins. See the [Expressive Code release notes](https://expressive-code.com/releases/#0340) for full details.
|
|
45
|
+
|
|
46
|
+
- [#1769](https://github.com/withastro/starlight/pull/1769) [`bd5f1cbd`](https://github.com/withastro/starlight/commit/bd5f1cbd5aef9e2d78e7f7187eb07deee87399d0) Thanks [@ncjones](https://github.com/ncjones)! - Adds support for [accessing frontmatter data as a variable](https://docs.astro.build/en/guides/integrations-guide/markdoc/#access-frontmatter-from-your-markdoc-content) when using Markdoc
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- [#1788](https://github.com/withastro/starlight/pull/1788) [`681a4273`](https://github.com/withastro/starlight/commit/681a427366755fec71ba65d45e36f7d1267cf387) Thanks [@dragomano](https://github.com/dragomano)! - Adds Russian translations for Expressive Code labels
|
|
51
|
+
|
|
52
|
+
- [#1780](https://github.com/withastro/starlight/pull/1780) [`4db6025a`](https://github.com/withastro/starlight/commit/4db6025a1c5c56cac2e3a98bd2e13124402445c7) Thanks [@MiahaCybersec](https://github.com/MiahaCybersec)! - Adds 1 new icon: `signal`
|
|
53
|
+
|
|
54
|
+
- [#1785](https://github.com/withastro/starlight/pull/1785) [`65009c9c`](https://github.com/withastro/starlight/commit/65009c9cf8b0570303ecb87713e1c2968a704437) Thanks [@dreyfus92](https://github.com/dreyfus92)! - Adds 5 new icons: `node`, `cloudflare`, `vercel`, `netlify` and `deno`
|
|
55
|
+
|
|
56
|
+
- [#1786](https://github.com/withastro/starlight/pull/1786) [`d05d693a`](https://github.com/withastro/starlight/commit/d05d693afcf1771b8269dfe2ccc94f8952c643e8) Thanks [@delucis](https://github.com/delucis)! - Fixes type inference for i18n strings added by extending the default schema
|
|
57
|
+
|
|
58
|
+
- [#1777](https://github.com/withastro/starlight/pull/1777) [`6949404b`](https://github.com/withastro/starlight/commit/6949404b24a1c8254fd32d75122fdfbaf896fe29) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes an issue where TypeScript could fail to serialize the frontmatter schema when configured to emit declaration files
|
|
59
|
+
|
|
60
|
+
- [#1734](https://github.com/withastro/starlight/pull/1734) [`4493dcfa`](https://github.com/withastro/starlight/commit/4493dcfac5171f839b1b0e39444a15ce696adee4) Thanks [@delucis](https://github.com/delucis)! - Refactors `<ThemeSelect>` custom element logic to improve performance
|
|
61
|
+
|
|
62
|
+
- [#1731](https://github.com/withastro/starlight/pull/1731) [`f08b0dff`](https://github.com/withastro/starlight/commit/f08b0dff9638bbe7704ac2ba2e855d8d1464ba76) Thanks [@techfg](https://github.com/techfg)! - Fixes responding to system color scheme changes when theme is `auto`
|
|
63
|
+
|
|
64
|
+
- [#1793](https://github.com/withastro/starlight/pull/1793) [`2616f0c7`](https://github.com/withastro/starlight/commit/2616f0c7acf39a99c9f92b3db4108cae81120034) Thanks [@Mrahmani71](https://github.com/Mrahmani71)! - Updates the Farsi UI translations
|
|
65
|
+
|
|
3
66
|
## 0.21.5
|
|
4
67
|
|
|
5
68
|
### Patch Changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/home/runner/work/starlight/starlight/node_modules/.pnpm/astro@4.3.5_@types+node@18.16.19/node_modules/astro/node_modules:/home/runner/work/starlight/starlight/node_modules/.pnpm/astro@4.3.5_@types+node@18.16.19/node_modules:/home/runner/work/starlight/starlight/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="/home/runner/work/starlight/starlight/node_modules/.pnpm/astro@4.3.5_@types+node@18.16.19/node_modules/astro/node_modules:/home/runner/work/starlight/starlight/node_modules/.pnpm/astro@4.3.5_@types+node@18.16.19/node_modules:/home/runner/work/starlight/starlight/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../astro/astro.js" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../astro/astro.js" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tabs with varying content heights
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
|
6
|
+
|
|
7
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
8
|
+
|
|
9
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
10
|
+
|
|
11
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
12
|
+
|
|
13
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
14
|
+
|
|
15
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
16
|
+
|
|
17
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
18
|
+
|
|
19
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
20
|
+
|
|
21
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
22
|
+
|
|
23
|
+
**A set of tabs using a sync key with content of different heights between tabs.**
|
|
24
|
+
|
|
25
|
+
<Tabs syncKey="things">
|
|
26
|
+
<TabItem label="A">
|
|
27
|
+
|
|
28
|
+
A little bit of text.
|
|
29
|
+
|
|
30
|
+
</TabItem>
|
|
31
|
+
<TabItem label="B">
|
|
32
|
+
|
|
33
|
+
A lot more text.
|
|
34
|
+
|
|
35
|
+
A lot more text.
|
|
36
|
+
|
|
37
|
+
A lot more text.
|
|
38
|
+
|
|
39
|
+
A lot more text.
|
|
40
|
+
|
|
41
|
+
A lot more text.
|
|
42
|
+
|
|
43
|
+
A lot more text.
|
|
44
|
+
|
|
45
|
+
A lot more text.
|
|
46
|
+
|
|
47
|
+
A lot more text.
|
|
48
|
+
|
|
49
|
+
A lot more text.
|
|
50
|
+
|
|
51
|
+
A lot more text.
|
|
52
|
+
|
|
53
|
+
</TabItem>
|
|
54
|
+
</Tabs>
|
|
55
|
+
|
|
56
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
57
|
+
|
|
58
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
59
|
+
|
|
60
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
61
|
+
|
|
62
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
63
|
+
|
|
64
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
65
|
+
|
|
66
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
67
|
+
|
|
68
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
69
|
+
|
|
70
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
71
|
+
|
|
72
|
+
**Another set of tabs using the same sync key with content of different heights between tabs.**
|
|
73
|
+
|
|
74
|
+
<Tabs syncKey="things">
|
|
75
|
+
<TabItem label="A">
|
|
76
|
+
|
|
77
|
+
A little bit of text.
|
|
78
|
+
|
|
79
|
+
</TabItem>
|
|
80
|
+
<TabItem label="B">
|
|
81
|
+
|
|
82
|
+
A lot more text.
|
|
83
|
+
|
|
84
|
+
A lot more text.
|
|
85
|
+
|
|
86
|
+
A lot more text.
|
|
87
|
+
|
|
88
|
+
A lot more text.
|
|
89
|
+
|
|
90
|
+
A lot more text.
|
|
91
|
+
|
|
92
|
+
A lot more text.
|
|
93
|
+
|
|
94
|
+
A lot more text.
|
|
95
|
+
|
|
96
|
+
A lot more text.
|
|
97
|
+
|
|
98
|
+
A lot more text.
|
|
99
|
+
|
|
100
|
+
A lot more text.
|
|
101
|
+
|
|
102
|
+
</TabItem>
|
|
103
|
+
</Tabs>
|
|
104
|
+
|
|
105
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
106
|
+
|
|
107
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
108
|
+
|
|
109
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
110
|
+
|
|
111
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
112
|
+
|
|
113
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
114
|
+
|
|
115
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
116
|
+
|
|
117
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
118
|
+
|
|
119
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
120
|
+
|
|
121
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
122
|
+
|
|
123
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
124
|
+
|
|
125
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
126
|
+
|
|
127
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
128
|
+
|
|
129
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
130
|
+
|
|
131
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
132
|
+
|
|
133
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
134
|
+
|
|
135
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
136
|
+
|
|
137
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
138
|
+
|
|
139
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
140
|
+
|
|
141
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
142
|
+
|
|
143
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
144
|
+
|
|
145
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
146
|
+
|
|
147
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
148
|
+
|
|
149
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
150
|
+
|
|
151
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tabs
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
|
6
|
+
|
|
7
|
+
A set of tabs using the `pkg` sync key.
|
|
8
|
+
|
|
9
|
+
<Tabs syncKey="pkg">
|
|
10
|
+
<TabItem label="npm">npm command</TabItem>
|
|
11
|
+
<TabItem label="pnpm">pnpm command</TabItem>
|
|
12
|
+
<TabItem label="yarn">yarn command</TabItem>
|
|
13
|
+
</Tabs>
|
|
14
|
+
|
|
15
|
+
A basic set of tabs.
|
|
16
|
+
|
|
17
|
+
<Tabs>
|
|
18
|
+
<TabItem label="one">tab 1</TabItem>
|
|
19
|
+
<TabItem label="two">tab 2</TabItem>
|
|
20
|
+
<TabItem label="three">tab 3</TabItem>
|
|
21
|
+
</Tabs>
|
|
22
|
+
|
|
23
|
+
Another set of tabs using the `pkg` sync key and an extra tab.
|
|
24
|
+
|
|
25
|
+
<Tabs syncKey="pkg">
|
|
26
|
+
<TabItem label="npm">another npm command</TabItem>
|
|
27
|
+
<TabItem label="pnpm">another pnpm command</TabItem>
|
|
28
|
+
<TabItem label="bun">another bun command</TabItem>
|
|
29
|
+
<TabItem label="yarn">another yarn command</TabItem>
|
|
30
|
+
</Tabs>
|
|
31
|
+
|
|
32
|
+
A set of tabs using the `style` sync key.
|
|
33
|
+
|
|
34
|
+
<Tabs syncKey="style">
|
|
35
|
+
<TabItem label="css">css code</TabItem>
|
|
36
|
+
<TabItem label="tailwind">tailwind code</TabItem>
|
|
37
|
+
</Tabs>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { expect, testFactory, type Locator } from './test-utils';
|
|
2
|
+
|
|
3
|
+
const test = await testFactory('./fixtures/basics/');
|
|
4
|
+
|
|
5
|
+
test('syncs tabs with a click event', async ({ page, starlight }) => {
|
|
6
|
+
await starlight.goto('/tabs');
|
|
7
|
+
|
|
8
|
+
const tabs = page.locator('starlight-tabs');
|
|
9
|
+
const pkgTabsA = tabs.nth(0);
|
|
10
|
+
const pkgTabsB = tabs.nth(2);
|
|
11
|
+
|
|
12
|
+
// Select the pnpm tab in the first set of synced tabs.
|
|
13
|
+
await pkgTabsA.getByRole('tab').filter({ hasText: 'pnpm' }).click();
|
|
14
|
+
|
|
15
|
+
await expectSelectedTab(pkgTabsA, 'pnpm', 'pnpm command');
|
|
16
|
+
await expectSelectedTab(pkgTabsB, 'pnpm', 'another pnpm command');
|
|
17
|
+
|
|
18
|
+
// Select the yarn tab in the second set of synced tabs.
|
|
19
|
+
await pkgTabsB.getByRole('tab').filter({ hasText: 'yarn' }).click();
|
|
20
|
+
|
|
21
|
+
await expectSelectedTab(pkgTabsB, 'yarn', 'another yarn command');
|
|
22
|
+
await expectSelectedTab(pkgTabsA, 'yarn', 'yarn command');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('syncs tabs with a keyboard event', async ({ page, starlight }) => {
|
|
26
|
+
await starlight.goto('/tabs');
|
|
27
|
+
|
|
28
|
+
const tabs = page.locator('starlight-tabs');
|
|
29
|
+
const pkgTabsA = tabs.nth(0);
|
|
30
|
+
const pkgTabsB = tabs.nth(2);
|
|
31
|
+
|
|
32
|
+
// Select the pnpm tab in the first set of synced tabs with the keyboard.
|
|
33
|
+
await pkgTabsA.getByRole('tab', { selected: true }).press('ArrowRight');
|
|
34
|
+
|
|
35
|
+
await expectSelectedTab(pkgTabsA, 'pnpm', 'pnpm command');
|
|
36
|
+
await expectSelectedTab(pkgTabsB, 'pnpm', 'another pnpm command');
|
|
37
|
+
|
|
38
|
+
// Select back the npm tab in the second set of synced tabs with the keyboard.
|
|
39
|
+
const selectedTabB = pkgTabsB.getByRole('tab', { selected: true });
|
|
40
|
+
await selectedTabB.press('ArrowRight');
|
|
41
|
+
await selectedTabB.press('ArrowLeft');
|
|
42
|
+
await selectedTabB.press('ArrowLeft');
|
|
43
|
+
|
|
44
|
+
await expectSelectedTab(pkgTabsA, 'npm', 'npm command');
|
|
45
|
+
await expectSelectedTab(pkgTabsB, 'npm', 'another npm command');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('syncs only tabs using the same sync key', async ({ page, starlight }) => {
|
|
49
|
+
await starlight.goto('/tabs');
|
|
50
|
+
|
|
51
|
+
const tabs = page.locator('starlight-tabs');
|
|
52
|
+
const pkgTabsA = tabs.nth(0);
|
|
53
|
+
const unsyncedTabs = tabs.nth(1);
|
|
54
|
+
const styleTabs = tabs.nth(3);
|
|
55
|
+
|
|
56
|
+
// Select the pnpm tab in the set of tabs synced with the 'pkg' key.
|
|
57
|
+
await pkgTabsA.getByRole('tab').filter({ hasText: 'pnpm' }).click();
|
|
58
|
+
|
|
59
|
+
await expectSelectedTab(unsyncedTabs, 'one', 'tab 1');
|
|
60
|
+
await expectSelectedTab(styleTabs, 'css', 'css code');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test('supports synced tabs with different tab items', async ({ page, starlight }) => {
|
|
64
|
+
await starlight.goto('/tabs');
|
|
65
|
+
|
|
66
|
+
const tabs = page.locator('starlight-tabs');
|
|
67
|
+
const pkgTabsA = tabs.nth(0);
|
|
68
|
+
const pkgTabsB = tabs.nth(2); // This set contains an extra tab item.
|
|
69
|
+
|
|
70
|
+
// Select the bun tab in the second set of synced tabs.
|
|
71
|
+
await pkgTabsB.getByRole('tab').filter({ hasText: 'bun' }).click();
|
|
72
|
+
|
|
73
|
+
await expectSelectedTab(pkgTabsA, 'npm', 'npm command');
|
|
74
|
+
await expectSelectedTab(pkgTabsB, 'bun', 'another bun command');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('persists the focus when syncing tabs', async ({ page, starlight }) => {
|
|
78
|
+
await starlight.goto('/tabs');
|
|
79
|
+
|
|
80
|
+
const pkgTabsA = page.locator('starlight-tabs').nth(0);
|
|
81
|
+
|
|
82
|
+
// Focus the selected tab in the set of tabs synced with the 'pkg' key.
|
|
83
|
+
await pkgTabsA.getByRole('tab', { selected: true }).focus();
|
|
84
|
+
// Select the pnpm tab in the set of tabs synced with the 'pkg' key using the keyboard.
|
|
85
|
+
await page.keyboard.press('ArrowRight');
|
|
86
|
+
|
|
87
|
+
expect(
|
|
88
|
+
await pkgTabsA
|
|
89
|
+
.getByRole('tab', { selected: true })
|
|
90
|
+
.evaluate((node) => document.activeElement === node)
|
|
91
|
+
).toBe(true);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('preserves tabs position when alternating between tabs with different content heights', async ({
|
|
95
|
+
page,
|
|
96
|
+
starlight,
|
|
97
|
+
}) => {
|
|
98
|
+
await starlight.goto('/tabs-variable-height');
|
|
99
|
+
|
|
100
|
+
const tabs = page.locator('starlight-tabs').nth(1);
|
|
101
|
+
const selectedTab = tabs.getByRole('tab', { selected: true });
|
|
102
|
+
|
|
103
|
+
// Scroll to the second set of synced tabs and focus the selected tab.
|
|
104
|
+
await tabs.scrollIntoViewIfNeeded();
|
|
105
|
+
await selectedTab.focus();
|
|
106
|
+
|
|
107
|
+
// Get the bounding box of the tabs.
|
|
108
|
+
const initialBoundingBox = await tabs.boundingBox();
|
|
109
|
+
|
|
110
|
+
// Select the second tab which has a different height.
|
|
111
|
+
await selectedTab.press('ArrowRight');
|
|
112
|
+
|
|
113
|
+
// Ensure the tabs vertical position is exactly the same after selecting the second tab.
|
|
114
|
+
// Note that a small difference could be the result of the base line-height having a fractional part which can cause a
|
|
115
|
+
// sub-pixel difference in some browsers like Chrome or Firefox.
|
|
116
|
+
expect((await tabs.boundingBox())?.y).toBe(initialBoundingBox?.y);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
async function expectSelectedTab(tabs: Locator, label: string, panel: string) {
|
|
120
|
+
expect((await tabs.getByRole('tab', { selected: true }).textContent())?.trim()).toBe(label);
|
|
121
|
+
expect((await tabs.getByRole('tabpanel').textContent())?.trim()).toBe(panel);
|
|
122
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { test as baseTest, type Page } from '@playwright/test';
|
|
3
|
+
import { build, preview } from 'astro';
|
|
4
|
+
|
|
5
|
+
export { expect, type Locator } from '@playwright/test';
|
|
6
|
+
|
|
7
|
+
// Setup a test environment that will build and start a preview server for a given fixture path and
|
|
8
|
+
// provide a Starlight Playwright fixture accessible from within all tests.
|
|
9
|
+
export async function testFactory(fixturePath: string) {
|
|
10
|
+
let previewServer: PreviewServer | undefined;
|
|
11
|
+
|
|
12
|
+
const test = baseTest.extend<{ starlight: StarlightPage }>({
|
|
13
|
+
starlight: async ({ page }, use) => {
|
|
14
|
+
if (!previewServer) {
|
|
15
|
+
throw new Error('Could not find a preview server to run tests against.');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
await use(new StarlightPage(previewServer, page));
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test.beforeAll(async () => {
|
|
23
|
+
const root = fileURLToPath(new URL(fixturePath, import.meta.url));
|
|
24
|
+
await build({ logLevel: 'error', root });
|
|
25
|
+
previewServer = await preview({ logLevel: 'error', root });
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test.afterAll(async () => {
|
|
29
|
+
await previewServer?.stop();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return test;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// A Playwright test fixture accessible from within all tests.
|
|
36
|
+
class StarlightPage {
|
|
37
|
+
constructor(
|
|
38
|
+
private readonly previewServer: PreviewServer,
|
|
39
|
+
private readonly page: Page
|
|
40
|
+
) {}
|
|
41
|
+
|
|
42
|
+
// Navigate to a URL relative to the server used during a test run and return the resource response.
|
|
43
|
+
goto(url: string) {
|
|
44
|
+
return this.page.goto(this.resolveUrl(url));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Resolve a URL relative to the server used during a test run.
|
|
48
|
+
resolveUrl(url: string) {
|
|
49
|
+
return `http://localhost:${this.previewServer.port}${url.replace(/^\/?/, '/')}`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type PreviewServer = Awaited<ReturnType<typeof preview>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Icons } from '../components/Icons';
|
|
3
|
+
import Icon from '../user-components/Icon.astro';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
icon: keyof typeof Icons;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { icon, label } = Astro.props;
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<p class="sl-flex">
|
|
14
|
+
<Icon name={icon} size="1.5em" color="var(--sl-color-orange-high)" />
|
|
15
|
+
<span>{label}</span>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
p {
|
|
20
|
+
border: 1px solid var(--sl-color-orange);
|
|
21
|
+
padding: 0.75em 1em;
|
|
22
|
+
background-color: var(--sl-color-orange-low);
|
|
23
|
+
color: var(--sl-color-orange-high);
|
|
24
|
+
width: max-content;
|
|
25
|
+
max-width: 100%;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 0.75em;
|
|
28
|
+
font-size: var(--sl-text-body-sm);
|
|
29
|
+
line-height: var(--sl-line-height-headings);
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -1,27 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import ContentNotice from './ContentNotice.astro';
|
|
3
3
|
import type { Props } from '../props';
|
|
4
4
|
|
|
5
5
|
const { labels } = Astro.props;
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
<
|
|
9
|
-
<Icon name={'warning'} size="1.5em" color="var(--sl-color-orange-high)" /><span
|
|
10
|
-
>{labels['i18n.untranslatedContent']}</span
|
|
11
|
-
>
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
<style>
|
|
15
|
-
p {
|
|
16
|
-
border: 1px solid var(--sl-color-orange);
|
|
17
|
-
padding: 0.75em 1em;
|
|
18
|
-
background-color: var(--sl-color-orange-low);
|
|
19
|
-
color: var(--sl-color-orange-high);
|
|
20
|
-
width: max-content;
|
|
21
|
-
max-width: 100%;
|
|
22
|
-
align-items: center;
|
|
23
|
-
gap: 0.75em;
|
|
24
|
-
font-size: var(--sl-text-body-sm);
|
|
25
|
-
line-height: var(--sl-line-height-headings);
|
|
26
|
-
}
|
|
27
|
-
</style>
|
|
8
|
+
<ContentNotice icon="warning" label={labels['i18n.untranslatedContent']} />
|
package/components/Head.astro
CHANGED
|
@@ -8,7 +8,7 @@ import { createHead } from '../utils/head';
|
|
|
8
8
|
import { localizedUrl } from '../utils/localizedUrl';
|
|
9
9
|
import type { Props } from '../props';
|
|
10
10
|
|
|
11
|
-
const { entry, lang } = Astro.props;
|
|
11
|
+
const { entry, lang, siteTitle } = Astro.props;
|
|
12
12
|
const { data } = entry;
|
|
13
13
|
|
|
14
14
|
const canonical = Astro.site ? new URL(Astro.url.pathname, Astro.site) : undefined;
|
|
@@ -20,7 +20,7 @@ const headDefaults: z.input<ReturnType<typeof HeadConfigSchema>> = [
|
|
|
20
20
|
tag: 'meta',
|
|
21
21
|
attrs: { name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
|
22
22
|
},
|
|
23
|
-
{ tag: 'title', content: `${data.title} ${config.titleDelimiter} ${
|
|
23
|
+
{ tag: 'title', content: `${data.title} ${config.titleDelimiter} ${siteTitle}` },
|
|
24
24
|
{ tag: 'link', attrs: { rel: 'canonical', href: canonical?.href } },
|
|
25
25
|
{ tag: 'meta', attrs: { name: 'generator', content: Astro.generator } },
|
|
26
26
|
{
|
|
@@ -42,7 +42,7 @@ const headDefaults: z.input<ReturnType<typeof HeadConfigSchema>> = [
|
|
|
42
42
|
{ tag: 'meta', attrs: { property: 'og:url', content: canonical?.href } },
|
|
43
43
|
{ tag: 'meta', attrs: { property: 'og:locale', content: lang } },
|
|
44
44
|
{ tag: 'meta', attrs: { property: 'og:description', content: description } },
|
|
45
|
-
{ tag: 'meta', attrs: { property: 'og:site_name', content:
|
|
45
|
+
{ tag: 'meta', attrs: { property: 'og:site_name', content: siteTitle } },
|
|
46
46
|
// Twitter Tags
|
|
47
47
|
{
|
|
48
48
|
tag: 'meta',
|
package/components/Icons.ts
CHANGED
|
@@ -103,6 +103,8 @@ export const BuiltInIcons = {
|
|
|
103
103
|
'<path d="M14.41 16.87a3.38 3.38 0 0 1-2.37.63 3.37 3.37 0 0 1-2.36-.63 1 1 0 0 0-1.42 1.41 5.11 5.11 0 0 0 3.78 1.22 5.12 5.12 0 0 0 3.78-1.22 1 1 0 1 0-1.41-1.41ZM9.2 15a1 1 0 1 0-1-1 1 1 0 0 0 1 1Zm6-2a1 1 0 1 0 1 1 1 1 0 0 0-1-1Zm7.8-1.22a3.77 3.77 0 0 0-6.8-2.26 16.5 16.5 0 0 0-3.04-.48l.85-5.7 2.09.7a3 3 0 0 0 6-.06v-.02a3.03 3.03 0 0 0-3-2.96 2.98 2.98 0 0 0-2.34 1.16l-3.24-1.1a1 1 0 0 0-1.3.8l-1.09 7.17a16.66 16.66 0 0 0-3.34.49 3.77 3.77 0 0 0-6.22 4.23A4.86 4.86 0 0 0 1 16c0 3.92 4.83 7 11 7s11-3.08 11-7a4.86 4.86 0 0 0-.57-2.25 3.78 3.78 0 0 0 .57-1.97ZM19.1 3a1 1 0 1 1-1 1 1.02 1.02 0 0 1 1-1ZM4.77 10a1.76 1.76 0 0 1 .88.25A9.98 9.98 0 0 0 3 11.92v-.14A1.78 1.78 0 0 1 4.78 10ZM12 21c-4.88 0-9-2.29-9-5s4.12-5 9-5 9 2.29 9 5-4.12 5-9 5Zm8.99-9.08a9.98 9.98 0 0 0-2.65-1.67 1.76 1.76 0 0 1 .88-.25A1.78 1.78 0 0 1 21 11.78l-.01.14Z"/>',
|
|
104
104
|
patreon:
|
|
105
105
|
'<path d="M22.04 7.6c0-2.8-2.19-5.1-4.75-5.93a15.19 15.19 0 0 0-10.44.55C3.16 3.96 2 7.78 1.95 11.58c-.02 3.12.3 11.36 4.94 11.42 3.45.04 3.97-4.4 5.56-6.55 1.14-1.52 2.6-1.95 4.4-2.4 3.1-.76 5.2-3.2 5.2-6.44Z"/>',
|
|
106
|
+
signal:
|
|
107
|
+
'<path d="m9.12.35.27 1.09a10.9 10.9 0 0 0-3.015 1.248l-.578-.964A12 12 0 0 1 9.12.35m5.76 0-.27 1.09a10.9 10.9 0 0 1 3.015 1.248l.581-.964A12 12 0 0 0 14.88.35M1.725 5.797A12 12 0 0 0 .351 9.119l1.09.27A10.9 10.9 0 0 1 2.69 6.374zm-.6 6.202a11 11 0 0 1 .122-1.63l-1.112-.168a12 12 0 0 0 0 3.596l1.112-.169A11 11 0 0 1 1.125 12zm17.078 10.275-.578-.964a10.9 10.9 0 0 1-3.011 1.247l.27 1.091a12 12 0 0 0 3.319-1.374M22.875 12a11 11 0 0 1-.122 1.63l1.112.168a12 12 0 0 0 0-3.596l-1.112.169a11 11 0 0 1 .122 1.63zm.774 2.88-1.09-.27a10.9 10.9 0 0 1-1.248 3.015l.964.581a12 12 0 0 0 1.374-3.326m-10.02 7.875a11 11 0 0 1-3.258 0l-.17 1.112a12 12 0 0 0 3.597 0zm7.125-4.303a11 11 0 0 1-2.304 2.302l.668.906a12 12 0 0 0 2.542-2.535zM18.45 3.245a11 11 0 0 1 2.304 2.304l.906-.675a12 12 0 0 0-2.535-2.535zM3.246 5.549A11 11 0 0 1 5.55 3.245l-.675-.906A12 12 0 0 0 2.34 4.874zm19.029.248-.964.577a10.9 10.9 0 0 1 1.247 3.011l1.091-.27a12 12 0 0 0-1.374-3.318M10.371 1.246a11 11 0 0 1 3.258 0L13.8.134a12 12 0 0 0-3.597 0zM3.823 21.957 1.5 22.5l.542-2.323-1.095-.257-.542 2.323a1.125 1.125 0 0 0 1.352 1.352l2.321-.532zm-2.642-3.041 1.095.255.375-1.61a10.8 10.8 0 0 1-1.21-2.952l-1.09.27a12 12 0 0 0 1.106 2.852zm5.25 2.437-1.61.375.255 1.095 1.185-.275a12 12 0 0 0 2.851 1.106l.27-1.091a10.8 10.8 0 0 1-2.943-1.217zM12 2.25a9.75 9.75 0 0 0-8.25 14.938l-.938 4 4-.938A9.75 9.75 0 1 0 12 2.25"/>',
|
|
106
108
|
slack:
|
|
107
109
|
'<path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52Zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313ZM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834Zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312Zm10.122 2.521a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834Zm-1.268 0a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312Zm-2.523 10.122a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52Zm0-1.268a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313Z"/>',
|
|
108
110
|
matrix:
|
|
@@ -126,6 +128,13 @@ export const BuiltInIcons = {
|
|
|
126
128
|
starlight:
|
|
127
129
|
'<path fill-rule="evenodd" d="M15.19 6.75 12 0 8.81 6.75l-.19.38-1.68-1.88a1.2 1.2 0 1 0-1.69 1.69L7.13 8.8h-.38L0 12l6.75 3.19h.38l-1.88 1.87a1.2 1.2 0 1 0 1.69 1.69l1.68-1.88.2.38L12 24l3.19-6.75v-.38l1.69 1.88a1.2 1.2 0 1 0 1.68-1.69l-1.68-1.68.37-.2L24 12l-6.75-3.19-.38-.19 1.7-1.68a1.2 1.2 0 1 0-1.7-1.69L15.2 7.13v-.38ZM12 7.13l-.38.93a8.18 8.18 0 0 1-3.56 3.56l-.94.38.94.38a8.18 8.18 0 0 1 3.56 3.56l.38.94.38-.94a8.18 8.18 0 0 1 3.56-3.56l.94-.38-.94-.38a8.18 8.18 0 0 1-3.56-3.56L12 7.12Z"/><path d="M22.12 3.56a1.2 1.2 0 1 0-1.68-1.69l-.57.57a1.2 1.2 0 0 0 1.7 1.68l.55-.56Zm-18 .75c-.37.38-1.12.38-1.68 0l-.57-.56a1.2 1.2 0 0 1 1.7-1.69l.55.56c.57.38.57 1.13 0 1.7Zm0 15.38c-.37-.38-1.12-.38-1.68 0l-.57.56a1.2 1.2 0 1 0 1.7 1.69l.55-.57c.57-.37.57-1.12 0-1.68Zm18 .75a1.2 1.2 0 1 1-1.68 1.68l-.57-.56a1.2 1.2 0 0 1 1.7-1.69l.55.57Z"/>',
|
|
128
130
|
pkl: '<path fill-rule="evenodd" d="M18.7 1.8 18 5a9 9 0 0 1 2 2.4l3.2.2c.4 1 .6 2 .7 3.1L21 12.2a9 9 0 0 1-.7 3l1.9 2.7c-.6 1-1.2 1.7-2 2.5l-3-1.3c-.9.6-1.9 1-2.9 1.4l-.9 3c-1 .2-2.1.2-3.2 0l-.8-3c-1-.4-2-.8-2.9-1.5l-3 1.3a12 12 0 0 1-2-2.5l2-2.6a9 9 0 0 1-.8-3L0 10.5c.1-1.1.3-2.1.7-3.1L4 7.3A9 9 0 0 1 6 5l-.6-3.2c1-.6 2-1 3-1.3l2 2.4c1.1-.2 2.2-.2 3.2 0L15.8.4c1 .3 2 .8 2.9 1.4Zm1 9.8c0 4.2-3.3 7.5-7.5 7.5a7.5 7.5 0 0 1-7.6-7.5c0-4.1 3.4-7.5 7.6-7.5 4.2 0 7.6 3.4 7.6 7.5Z"></path><path fill-opacity=".5" d="M11.4 10.8c-6.6-2.7-3.6-5.5.4-5.5 4.3 0 7.8 2.5 1.2 5.5a2 2 0 0 1-1.6 0Zm.4 1.9c1 7-3 5.8-5 2.5-2.1-3.7-1.7-8 4.2-3.9a2 2 0 0 1 .8 1.4Zm6.2 1.7c2-3.3 1-7.3-4.7-3a2 2 0 0 0-.8 1.4c-.7 7.1 3.3 5.4 5.5 1.7Z"/>',
|
|
131
|
+
node: '<path d="M12 23.96c-.34 0-.66-.1-.96-.25l-3.03-1.73c-.45-.25-.22-.33-.09-.38.62-.2.73-.24 1.37-.6.07-.04.16-.02.23.03l2.32 1.34c.1.05.2.05.27 0l9.1-5.08a.27.27 0 0 0 .13-.24V6.9c0-.11-.05-.2-.14-.24L12.11 1.6c-.09-.05-.2-.05-.27 0L2.75 6.66c-.09.04-.13.15-.13.24v10.14c0 .1.04.2.13.25l2.49 1.38c1.34.66 2.18-.1 2.18-.88V7.78c0-.13.12-.26.28-.26h1.16c.13 0 .27.1.27.26v10.01c0 1.74-.98 2.75-2.69 2.75-.52 0-.93 0-2.1-.55l-2.38-1.32a1.85 1.85 0 0 1-.96-1.6V6.92c0-.66.36-1.28.96-1.6l9.08-5.1a2.1 2.1 0 0 1 1.92 0l9.08 5.08c.6.33.96.95.96 1.61v10.15c0 .66-.36 1.27-.96 1.6l-9.08 5.09a2.4 2.4 0 0 1-.96.2m2.8-6.98c-3.98 0-4.8-1.76-4.8-3.26 0-.13.11-.26.27-.26h1.18c.14 0 .25.08.25.22.19 1.16.71 1.73 3.12 1.73 1.92 0 2.74-.41 2.74-1.4 0-.58-.23-1-3.21-1.28-2.49-.24-4.04-.77-4.04-2.68 0-1.79 1.55-2.84 4.15-2.84 2.91 0 4.35.96 4.53 3.08a.35.35 0 0 1-.07.2.27.27 0 0 1-.18.08h-1.18a.27.27 0 0 1-.25-.2c-.28-1.2-.98-1.6-2.85-1.6-2.1 0-2.35.7-2.35 1.23 0 .64.3.84 3.12 1.19 2.8.35 4.13.86 4.13 2.75-.03 1.94-1.67 3.04-4.56 3.04"/>',
|
|
132
|
+
cloudflare:
|
|
133
|
+
'<path d="M16.5 16.84c.16-.5.1-.97-.15-1.3-.22-.33-.6-.5-1.06-.53l-8.66-.11a.15.15 0 0 1-.13-.08.21.21 0 0 1-.02-.15.25.25 0 0 1 .2-.15l8.74-.12a3.13 3.13 0 0 0 2.55-1.91l.5-1.3a.25.25 0 0 0 .01-.17 5.68 5.68 0 0 0-10.93-.59 2.58 2.58 0 0 0-3.35.24 2.55 2.55 0 0 0-.67 2.44 3.64 3.64 0 0 0-3.5 4.17.18.18 0 0 0 .17.15h15.98a.22.22 0 0 0 .21-.16l.12-.43Zm2.77-5.56-.24.01c-.06 0-.1.05-.13.1l-.34 1.18c-.15.5-.1.97.16 1.31.22.32.6.5 1.06.52l1.84.12c.06 0 .1.02.14.07.02.04.03.1.02.15a.23.23 0 0 1-.2.15l-1.93.12a3.11 3.11 0 0 0-2.55 1.91l-.14.36c-.03.07.02.14.1.14h6.6a.18.18 0 0 0 .16-.12 4.74 4.74 0 0 0-4.56-6v-.02Z"/>',
|
|
134
|
+
vercel: '<path d="m12 1l12 21H0z"/>',
|
|
135
|
+
netlify:
|
|
136
|
+
'<path d="M6.49 19.04h-.23L5.13 17.9v-.23l1.73-1.71h1.2l.15.15v1.2L6.5 19.04ZM5.13 6.31V6.1l1.13-1.13h.23L8.2 6.68v1.2l-.15.15h-1.2zm9.96 9.09h-1.65l-.14-.13v-3.83c0-.68-.27-1.2-1.1-1.23c-.42 0-.9 0-1.43.02l-.07.08v4.96l-.14.14H8.9l-.13-.14V8.73l.13-.14h3.7a2.6 2.6 0 0 1 2.61 2.6v4.08l-.13.14Zm-8.37-2.44H.14L0 12.82v-1.64l.14-.14h6.58l.14.14v1.64zm17.14 0h-6.58l-.14-.14v-1.64l.14-.14h6.58l.14.14v1.64zM11.05 6.55V1.64l.14-.14h1.65l.14.14v4.9l-.14.14h-1.65zm0 15.81v-4.9l.14-.14h1.65l.14.13v4.91l-.14.14h-1.65z"/>',
|
|
137
|
+
deno: '<path d="M12 0a12 12 0 1 1 0 24 12 12 0 0 1 0-24m-.47 6.8c-3.49 0-6.2 2.19-6.2 4.92 0 2.58 2.5 4.23 6.37 4.15h.12l.42-.02-.1.28v.03l.09.22v.03l.02.04.02.07.02.04.01.05.02.05.02.07.02.08.02.06.02.08.02.09.02.09.03.1.01.06.03.1.02.1.03.15.02.07.02.11.03.12.02.12.04.17.02.15.04.2.02.1.03.15.03.15.04.22.04.23.04.23.04.24.04.24.04.26.04.26.04.2.05.34.02.14.06.36.04.3.04.22.04.31.03.16a10.76 10.76 0 0 0 6.53-3.41l.05-.06-.24-.89-.64-2.37-.39-1.47-.35-1.3-.21-.78-.14-.5-.08-.3-.07-.26-.03-.11-.02-.07-.01-.03v-.03a6.04 6.04 0 0 0-2.05-2.97 6.75 6.75 0 0 0-4.25-1.35M8.47 19.3a.59.59 0 0 0-.72.4v.01l-.53 1.96q.5.24 1.01.43l.08.03.57-2.11V20a.59.59 0 0 0-.41-.7m3.26-1.43a.59.59 0 0 0-.71.4v.01l-.8 2.96v.01a.59.59 0 0 0 1.12.3l.8-2.96v-.02l.02-.06v-.02l-.02-.1-.02-.14-.02-.08a.58.58 0 0 0-.37-.3Zm-5.55-3.04a1 1 0 0 0-.04.09v.02l-.8 2.95v.02a.59.59 0 0 0 1.13.3v-.01l.72-2.68a5.3 5.3 0 0 1-1.01-.7Zm-1.9-3.4a.59.59 0 0 0-.72.4v.02l-.8 2.95v.01a.59.59 0 0 0 1.13.3l.8-2.96v-.01a.59.59 0 0 0-.41-.7m17.87-.68a.59.59 0 0 0-.72.4v.02l-.8 2.95v.01a.59.59 0 0 0 1.13.3l.8-2.96v-.01a.59.59 0 0 0-.41-.7M2.55 6.81a10.7 10.7 0 0 0-1.26 3.93.59.59 0 0 0 1-.22v-.02l.8-2.95v-.01a.59.59 0 0 0-.55-.73m17.59.02a.59.59 0 0 0-.72.4v.01l-.8 2.96v.01a.59.59 0 0 0 1.13.3l.8-2.96v-.01a.59.59 0 0 0-.41-.7Zm-7.85 1.93a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5M6.01 4.03a.59.59 0 0 0-.71.4v.02L4.5 7.4v.01a.59.59 0 0 0 1.12.3l.8-2.96v-.01a.59.59 0 0 0-.41-.7Zm10.24.56a.59.59 0 0 0-.71.4V5L15 7q.52.26.99.6l.05.04.62-2.32V5.3a.59.59 0 0 0-.41-.7m-5.21-3.34a11 11 0 0 0-1.12.16l-.07.01L9.1 4.2v.01a.59.59 0 0 0 1.13.3l.8-2.96v-.01a.6.6 0 0 0 0-.27m7.34 2.04-.16.58v.02a.59.59 0 0 0 1.13.3V4.2l.02-.07a11 11 0 0 0-.92-.77zm-4.64-1.94-.28 1.05a.59.59 0 0 0 1.13.31v-.01l.3-1.1q-.52-.15-1.06-.24z"/>',
|
|
129
138
|
};
|
|
130
139
|
|
|
131
140
|
export const Icons = {
|
package/components/Page.astro
CHANGED
|
@@ -11,6 +11,7 @@ import '../style/util.css';
|
|
|
11
11
|
import Banner from 'virtual:starlight/components/Banner';
|
|
12
12
|
import ContentPanel from 'virtual:starlight/components/ContentPanel';
|
|
13
13
|
import FallbackContentNotice from 'virtual:starlight/components/FallbackContentNotice';
|
|
14
|
+
import DraftContentNotice from 'virtual:starlight/components/DraftContentNotice';
|
|
14
15
|
import Footer from 'virtual:starlight/components/Footer';
|
|
15
16
|
import Head from 'virtual:starlight/components/Head';
|
|
16
17
|
import Header from 'virtual:starlight/components/Header';
|
|
@@ -101,6 +102,7 @@ const pagefindEnabled =
|
|
|
101
102
|
<>
|
|
102
103
|
<ContentPanel {...Astro.props}>
|
|
103
104
|
<PageTitle {...Astro.props} />
|
|
105
|
+
{Astro.props.entry.data.draft && <DraftContentNotice {...Astro.props} />}
|
|
104
106
|
{Astro.props.isFallback && <FallbackContentNotice {...Astro.props} />}
|
|
105
107
|
</ContentPanel>
|
|
106
108
|
<ContentPanel {...Astro.props}>
|
|
@@ -4,6 +4,7 @@ import config from 'virtual:starlight/user-config';
|
|
|
4
4
|
import type { Props } from '../props';
|
|
5
5
|
import { formatPath } from '../utils/format-path';
|
|
6
6
|
|
|
7
|
+
const { siteTitle } = Astro.props;
|
|
7
8
|
const href = formatPath(Astro.props.locale || '/');
|
|
8
9
|
---
|
|
9
10
|
|
|
@@ -32,7 +33,7 @@ const href = formatPath(Astro.props.locale || '/');
|
|
|
32
33
|
)
|
|
33
34
|
}
|
|
34
35
|
<span class:list={{ 'sr-only': config.logo?.replacesTitle }}>
|
|
35
|
-
{
|
|
36
|
+
{siteTitle}
|
|
36
37
|
</span>
|
|
37
38
|
</a>
|
|
38
39
|
|