@astrojs/starlight 0.34.3 → 0.34.5
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 +22 -0
- package/components/Page.astro +1 -1
- package/package.json +1 -1
- package/style/anchor-links.css +3 -0
- package/style/props.css +1 -0
- package/translations/da.json +6 -6
- package/translations/de.json +3 -3
- package/translations/vi.json +14 -14
- package/user-components/Card.astro +1 -0
- package/utils/i18n.ts +4 -1
- package/utils/starlight-page.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @astrojs/starlight
|
|
2
2
|
|
|
3
|
+
## 0.34.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#3282](https://github.com/withastro/starlight/pull/3282) [`7680e87`](https://github.com/withastro/starlight/commit/7680e878fc55eba3fe0cf90e793970d3b72d166a) Thanks [@alvinometric](https://github.com/alvinometric)! - Moves padding of `<main>` element to a `--sl-main-pad` CSS custom property to simplify setting custom values
|
|
8
|
+
|
|
9
|
+
- [#3288](https://github.com/withastro/starlight/pull/3288) [`131371e`](https://github.com/withastro/starlight/commit/131371e0c897f9c7ea673d93e8f405200d04d312) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes a potential configuration issue for multilingual sites with a default language including a regional subtag.
|
|
10
|
+
|
|
11
|
+
## 0.34.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#3205](https://github.com/withastro/starlight/pull/3205) [`95d124a`](https://github.com/withastro/starlight/commit/95d124ae99f207afd83f305943fa29df32cbbfc9) Thanks [@sgalcheung](https://github.com/sgalcheung)! - Fixes an issue preventing to use the `<StarlightPage>` component when the `docs` content collection that Starlight uses does not exist.
|
|
16
|
+
|
|
17
|
+
- [#3206](https://github.com/withastro/starlight/pull/3206) [`e6ea584`](https://github.com/withastro/starlight/commit/e6ea5848b20afbb654fd6684956336491b974dc7) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes a text selection issue for heading with a clickable anchor link when using double click to select text in Chrome and Safari.
|
|
18
|
+
|
|
19
|
+
- [#3233](https://github.com/withastro/starlight/pull/3233) [`3064c40`](https://github.com/withastro/starlight/commit/3064c40b54227b6309b35b6e44e397fae8f284a4) Thanks [@torn4dom4n](https://github.com/torn4dom4n)! - Updates Vietnamese UI translations.
|
|
20
|
+
|
|
21
|
+
- [#3248](https://github.com/withastro/starlight/pull/3248) [`16c1239`](https://github.com/withastro/starlight/commit/16c1239b36346e84b794fab819d6ad7a9854a244) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Prevents [icons in the `<Card>` component](https://starlight.astro.build/components/cards/#add-icons-to-cards) from being shrunk in some narrow viewports.
|
|
22
|
+
|
|
23
|
+
- [#3225](https://github.com/withastro/starlight/pull/3225) [`21b93b8`](https://github.com/withastro/starlight/commit/21b93b8ac1894c5ada99a641e516086ebee6ea37) Thanks [@randomguy-2650](https://github.com/randomguy-2650)! - Updates German UI translations
|
|
24
|
+
|
|
3
25
|
## 0.34.3
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/components/Page.astro
CHANGED
|
@@ -63,7 +63,7 @@ if (pagefindEnabled) mainDataAttributes['data-pagefind-body'] = '';
|
|
|
63
63
|
scroll-padding-top: calc(1.5rem + var(--sl-nav-height) + var(--sl-mobile-toc-height));
|
|
64
64
|
}
|
|
65
65
|
main {
|
|
66
|
-
padding
|
|
66
|
+
padding: var(--sl-main-pad);
|
|
67
67
|
}
|
|
68
68
|
@media (min-width: 50em) {
|
|
69
69
|
[data-has-sidebar] {
|
package/package.json
CHANGED
package/style/anchor-links.css
CHANGED
|
@@ -91,6 +91,9 @@ how we do it.
|
|
|
91
91
|
/* Prevent double or triple clicks from potentially selecting the anchor link a11y text. */
|
|
92
92
|
-webkit-user-select: none;
|
|
93
93
|
user-select: none;
|
|
94
|
+
/* Prevent double clicks on the last word (or single word) of a heading to include an extra new
|
|
95
|
+
line in Chrome and Safari. */
|
|
96
|
+
display: inline-flex;
|
|
94
97
|
}
|
|
95
98
|
|
|
96
99
|
/* Increase clickable area for anchor links with a pseudo element that doesn’t impact layout. */
|
package/style/props.css
CHANGED
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
--sl-sidebar-pad-x: 1rem;
|
|
102
102
|
--sl-content-width: 45rem;
|
|
103
103
|
--sl-content-pad-x: 1rem;
|
|
104
|
+
--sl-main-pad: 0 0 3vh 0;
|
|
104
105
|
--sl-menu-button-size: 2rem;
|
|
105
106
|
--sl-nav-gap: var(--sl-content-pad-x);
|
|
106
107
|
/* Offset required to show outline inside an element instead of round the outside */
|
package/translations/da.json
CHANGED
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"page.lastUpdated": "Sidst opdateret:",
|
|
19
19
|
"page.previousLink": "Forrige",
|
|
20
20
|
"page.nextLink": "Næste",
|
|
21
|
-
"page.draft": "
|
|
21
|
+
"page.draft": "Indholdet er en kladde og vil ikke blive inkluderet i produktions versioner.",
|
|
22
22
|
"404.text": "Siden er ikke fundet. Tjek din URL eller prøv søgelinjen.",
|
|
23
23
|
"aside.note": "Note",
|
|
24
24
|
"aside.tip": "Tip",
|
|
25
|
-
"aside.caution": "
|
|
26
|
-
"aside.danger": "
|
|
27
|
-
"fileTree.directory": "
|
|
28
|
-
"builtWithStarlight.label": "
|
|
29
|
-
"heading.anchorLabel": "
|
|
25
|
+
"aside.caution": "Bemærk",
|
|
26
|
+
"aside.danger": "Advarsel",
|
|
27
|
+
"fileTree.directory": "Mappe",
|
|
28
|
+
"builtWithStarlight.label": "Bygget med Starlight",
|
|
29
|
+
"heading.anchorLabel": "Sektion kaldt “{{title}}”"
|
|
30
30
|
}
|
package/translations/de.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"search.label": "Suchen",
|
|
4
4
|
"search.ctrlKey": "Strg",
|
|
5
5
|
"search.cancelLabel": "Abbrechen",
|
|
6
|
-
"search.devWarning": "
|
|
6
|
+
"search.devWarning": "Die Suche ist nur in Produktions-Builds verfügbar. \nVersuche, die Website zu bauen und in der Vorschau anzusehen, um sie lokal zu testen.",
|
|
7
7
|
"themeSelect.accessibleLabel": "Farbschema wählen",
|
|
8
8
|
"themeSelect.dark": "Dunkel",
|
|
9
9
|
"themeSelect.light": "Hell",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"page.lastUpdated": "Zuletzt bearbeitet:",
|
|
19
19
|
"page.previousLink": "Vorherige Seite",
|
|
20
20
|
"page.nextLink": "Nächste Seite",
|
|
21
|
-
"page.draft": "
|
|
21
|
+
"page.draft": "Dieser Inhalt ist ein Entwurf und wird nicht in den Produktions-Builds enthalten sein.",
|
|
22
22
|
"404.text": "Seite nicht gefunden. Überprüfe die URL oder nutze die Suchleiste.",
|
|
23
23
|
"aside.note": "Hinweis",
|
|
24
24
|
"aside.tip": "Tipp",
|
|
25
25
|
"aside.caution": "Achtung",
|
|
26
26
|
"aside.danger": "Gefahr",
|
|
27
|
-
"fileTree.directory": "
|
|
27
|
+
"fileTree.directory": "Ordner",
|
|
28
28
|
"builtWithStarlight.label": "Erstellt mit Starlight",
|
|
29
29
|
"heading.anchorLabel": "Abschnitt betitelt „{{title}}“"
|
|
30
30
|
}
|
package/translations/vi.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"skipLink.label": "Bỏ qua nội dung",
|
|
2
|
+
"skipLink.label": "Bỏ qua để đến nội dung",
|
|
3
3
|
"search.label": "Tìm kiếm",
|
|
4
4
|
"search.ctrlKey": "Ctrl",
|
|
5
|
-
"search.cancelLabel": "
|
|
6
|
-
"search.devWarning": "
|
|
5
|
+
"search.cancelLabel": "Hủy",
|
|
6
|
+
"search.devWarning": "Chức năng tìm kiếm chỉ có sẵn trong các phiên bản thật.\nHãy thử xây dựng và xem trước trang web để kiểm tra.",
|
|
7
7
|
"themeSelect.accessibleLabel": "Chọn giao diện",
|
|
8
8
|
"themeSelect.dark": "Tối",
|
|
9
9
|
"themeSelect.light": "Sáng",
|
|
@@ -11,20 +11,20 @@
|
|
|
11
11
|
"languageSelect.accessibleLabel": "Chọn ngôn ngữ",
|
|
12
12
|
"menuButton.accessibleLabel": "Menu",
|
|
13
13
|
"sidebarNav.accessibleLabel": "Chính",
|
|
14
|
-
"tableOfContents.onThisPage": "
|
|
15
|
-
"tableOfContents.overview": "Tổng
|
|
16
|
-
"i18n.untranslatedContent": "Nội dung này
|
|
14
|
+
"tableOfContents.onThisPage": "Trên trang này",
|
|
15
|
+
"tableOfContents.overview": "Tổng quan",
|
|
16
|
+
"i18n.untranslatedContent": "Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.",
|
|
17
17
|
"page.editLink": "Chỉnh sửa trang",
|
|
18
18
|
"page.lastUpdated": "Cập nhật lần cuối:",
|
|
19
|
-
"page.previousLink": "
|
|
20
|
-
"page.nextLink": "
|
|
21
|
-
"page.draft": "
|
|
22
|
-
"404.text": "Không tìm thấy trang.
|
|
19
|
+
"page.previousLink": "Trước",
|
|
20
|
+
"page.nextLink": "Tiếp",
|
|
21
|
+
"page.draft": "Nội dung này là bản nháp và sẽ không được đưa vào các phiên bản thật.",
|
|
22
|
+
"404.text": "Không tìm thấy trang. Hãy kiểm tra lại URL hoặc thử dùng thanh tìm kiếm.",
|
|
23
23
|
"aside.note": "Ghi chú",
|
|
24
24
|
"aside.tip": "Mẹo",
|
|
25
|
-
"aside.caution": "
|
|
25
|
+
"aside.caution": "Chú ý",
|
|
26
26
|
"aside.danger": "Nguy hiểm",
|
|
27
|
-
"fileTree.directory": "
|
|
28
|
-
"builtWithStarlight.label": "
|
|
29
|
-
"heading.anchorLabel": "
|
|
27
|
+
"fileTree.directory": "Thư mục",
|
|
28
|
+
"builtWithStarlight.label": "Được xây dựng bằng Starlight",
|
|
29
|
+
"heading.anchorLabel": "Phần tiêu đề “{{title}}”"
|
|
30
30
|
}
|
package/utils/i18n.ts
CHANGED
|
@@ -53,8 +53,11 @@ export function processI18nConfig(
|
|
|
53
53
|
/** Generate an Astro i18n configuration based on a Starlight configuration. */
|
|
54
54
|
function getAstroI18nConfig(config: StarlightConfig): NonNullable<AstroConfig['i18n']> {
|
|
55
55
|
return {
|
|
56
|
+
// When using custom locale `path`s, the default locale must match one of these paths.
|
|
57
|
+
// In Starlight, this matches the `locale` property if defined, and we fallback to the `lang`
|
|
58
|
+
// property if not (which would be set to the language’s directory name by default).
|
|
56
59
|
defaultLocale:
|
|
57
|
-
config.defaultLocale.
|
|
60
|
+
config.defaultLocale.locale ?? config.defaultLocale.lang ?? BuiltInDefaultLocale.lang,
|
|
58
61
|
locales: config.locales
|
|
59
62
|
? Object.entries(config.locales).map(([locale, localeConfig]) => {
|
|
60
63
|
return {
|
package/utils/starlight-page.ts
CHANGED
|
@@ -211,5 +211,5 @@ async function getUserDocsSchema(): Promise<
|
|
|
211
211
|
NonNullable<ContentConfig['collections']['docs']['schema']>
|
|
212
212
|
> {
|
|
213
213
|
const userCollections = (await import('virtual:starlight/collection-config')).collections;
|
|
214
|
-
return userCollections?.docs
|
|
214
|
+
return userCollections?.docs?.schema ?? docsSchema();
|
|
215
215
|
}
|