@astrojs/starlight 0.32.4 → 0.32.6
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 +18 -0
- package/components/Icons.ts +4 -1
- package/package.json +1 -1
- package/schemas/social.ts +4 -0
- package/translations/ko.json +4 -4
- package/utils/routing/types.ts +2 -2
- package/utils/starlight-page.ts +1 -4
- package/utils/user-config.ts +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @astrojs/starlight
|
|
2
2
|
|
|
3
|
+
## 0.32.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#3030](https://github.com/withastro/starlight/pull/3030) [`5bdf139`](https://github.com/withastro/starlight/commit/5bdf139191a20f19458b027617877c1063b46724) Thanks [@trueberryless](https://github.com/trueberryless)! - Updates the type of the `isFallback` field in route data from `true` to `boolean`, keeping it optional but allowing `false` as a possible value.
|
|
8
|
+
|
|
9
|
+
- [#3018](https://github.com/withastro/starlight/pull/3018) [`188b8cf`](https://github.com/withastro/starlight/commit/188b8cfa8ad8761365b8b557c4b9fea671050ed6) Thanks [@trueberryless](https://github.com/trueberryless)! - Adds validation for user config `routeMiddleware` so it does not conflict with [Astro's middleware](https://docs.astro.build/en/guides/middleware/).
|
|
10
|
+
|
|
11
|
+
## 0.32.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#3021](https://github.com/withastro/starlight/pull/3021) [`e3f881e`](https://github.com/withastro/starlight/commit/e3f881ec23019689b821c638b8f0863b8ced6908) Thanks [@jsparkdev](https://github.com/jsparkdev)! - Updates Korean language support
|
|
16
|
+
|
|
17
|
+
- [#3020](https://github.com/withastro/starlight/pull/3020) [`58e3e84`](https://github.com/withastro/starlight/commit/58e3e84662167e43c4a8b707453898e047aa18fc) Thanks [@ayoayco](https://github.com/ayoayco)! - Add SourceHut social icon
|
|
18
|
+
|
|
19
|
+
- [#3013](https://github.com/withastro/starlight/pull/3013) [`5b599dd`](https://github.com/withastro/starlight/commit/5b599dd6190d3b57f61ae48c8614395dda23ef13) Thanks [@oluwatobiss](https://github.com/oluwatobiss)! - Adds Substack icon to social links list
|
|
20
|
+
|
|
3
21
|
## 0.32.4
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/components/Icons.ts
CHANGED
|
@@ -104,7 +104,6 @@ export const BuiltInIcons = {
|
|
|
104
104
|
'<path d="M2.5 1 1 4.8v15.4h5.5V23h3.1l3-2.8H17l6-5.7V1H2.6ZM21 13.5l-3.4 3.3H12l-3 2.8v-2.8H4.5V3H21v10.5Zm-3.4-6.8v5.8h-2V6.7h2Zm-5.5 0v5.8h-2V6.7h2Z"/>',
|
|
105
105
|
azureDevOps:
|
|
106
106
|
'<path d="M17,4v9.74l-4,3.28-6.2-2.26V17L3.29,12.41l10.23.8V4.44Zm-3.41.49L7.85,1V3.29L2.58,4.84,1,6.87v4.61l2.26,1V6.57Z"/>',
|
|
107
|
-
|
|
108
107
|
microsoftTeams:
|
|
109
108
|
'<path d="M13.78 7.2a3.63 3.63 0 1 0-4.3-3.68h1.78a2.52 2.52 0 0 1 2.52 2.53V7.2zM7.34 18.8h3.92a2.52 2.52 0 0 0 2.52-2.52V8.37h4.17c.58.01 1.04.5 1.03 1.07v6.45a6.3 6.3 0 0 1-6.14 6.43 6.3 6.3 0 0 1-5.5-3.52zm16.1-14.06a2.51 2.51 0 1 1-5.02 0 2.51 2.51 0 0 1 5.02 0zm-3.36 14.24h-.17c.4-1 .59-2.05.57-3.11V9.46c0-.38-.07-.75-.23-1.09h2.69c.58 0 1.06.48 1.06 1.06v5.65a3.9 3.9 0 0 1-3.9 3.9h-.02z"/><path d="M1.02 5.02h10.24c.56 0 1.02.46 1.02 1.03v10.23a1.02 1.02 0 0 1-1.02 1.02H1.02A1.02 1.02 0 0 1 0 16.28V6.04c0-.56.46-1.02 1.02-1.02zm7.81 3.9V7.84H3.45v1.08h2.03v5.57h1.3V8.92h2.05z"/>',
|
|
110
109
|
instagram:
|
|
@@ -190,6 +189,10 @@ export const BuiltInIcons = {
|
|
|
190
189
|
sketch:
|
|
191
190
|
'<path d="m.29 8.99 4.8-6.53a.6.6 0 0 1 .42-.24l6.42-.71a.6.6 0 0 1 .14 0l6.42.71a.6.6 0 0 1 .42.24L23.7 9a.6.6 0 0 1-.02.75L12.34 22.86a.45.45 0 0 1-.68 0L.31 9.74a.6.6 0 0 1-.02-.75Zm13.36-5.55a.15.15 0 0 0-.21.2l3.04 3.75a.3.3 0 0 1-.23.49h-8.5a.3.3 0 0 1-.23-.5l3.05-3.74a.15.15 0 0 0-.22-.2L5.8 7.72a.3.3 0 0 1-.5-.24l.21-3.04a.15.15 0 0 0-.3-.05l-.99 3.48a.75.75 0 0 1-.48.5l-2.19.71a.15.15 0 0 0 .05.3h2.1a.75.75 0 0 1 .64.34l5.56 8.74a.23.23 0 0 0 .39-.22L6.3 10.02a.45.45 0 0 1 .4-.64h10.57a.45.45 0 0 1 .4.64l-3.98 8.22a.22.22 0 0 0 .4.22l5.55-8.74a.75.75 0 0 1 .64-.34h2.04a.15.15 0 0 0 .04-.3l-2.12-.7a.75.75 0 0 1-.48-.51l-1-3.48a.15.15 0 0 0-.17-.1.15.15 0 0 0-.12.15l.22 3.04a.3.3 0 0 1-.51.24l-4.54-4.28Z"/>',
|
|
192
191
|
npm: '<path d="M1.76 0h20.48a1.76 1.76 0 0 1 1.76 1.76v20.48a1.76 1.76 0 0 1-1.76 1.76H1.76A1.76 1.76 0 0 1 0 22.24V1.76A1.76 1.76 0 0 1 1.76 0zM5.11 19.16h6.93V8.8h3.47v10.36h3.47V5.34H5.13v13.82z"></path>',
|
|
192
|
+
sourcehut:
|
|
193
|
+
'<path d="M12 20a8 8 0 0 1-8-8 8 8 0 0 1 8-8 8 8 0 0 1 8 8 8 8 0 0 1-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2"/>',
|
|
194
|
+
substack:
|
|
195
|
+
'<path d="M22.5 8.2h-21V5.4h21v2.8zm-21 2.6V24L12 18.1 22.5 24V10.8h-21zM22.5 0h-21v2.8h21V0z"/>',
|
|
193
196
|
};
|
|
194
197
|
|
|
195
198
|
export const Icons = {
|
package/package.json
CHANGED
package/schemas/social.ts
CHANGED
|
@@ -42,6 +42,8 @@ export const socialLinks = [
|
|
|
42
42
|
'jira',
|
|
43
43
|
'storybook',
|
|
44
44
|
'npm',
|
|
45
|
+
'sourcehut',
|
|
46
|
+
'substack',
|
|
45
47
|
] as const;
|
|
46
48
|
|
|
47
49
|
export const SocialLinksSchema = () =>
|
|
@@ -99,6 +101,8 @@ export const SocialLinksSchema = () =>
|
|
|
99
101
|
jira: 'Jira',
|
|
100
102
|
storybook: 'Storybook',
|
|
101
103
|
npm: 'npm',
|
|
104
|
+
sourcehut: 'SourceHut',
|
|
105
|
+
substack: 'Substack',
|
|
102
106
|
}[key];
|
|
103
107
|
labelledLinks[key] = { label, url };
|
|
104
108
|
}
|
package/translations/ko.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"search.label": "검색",
|
|
4
4
|
"search.ctrlKey": "Ctrl",
|
|
5
5
|
"search.cancelLabel": "취소",
|
|
6
|
-
"search.devWarning": "검색 기능은
|
|
6
|
+
"search.devWarning": "검색 기능은 프로덕션 환경에서만 사용할 수 있습니다. \n사이트를 빌드하고 미리 보기를 실행하여 로컬에서 테스트하세요.",
|
|
7
7
|
"themeSelect.accessibleLabel": "테마 선택",
|
|
8
8
|
"themeSelect.dark": "다크",
|
|
9
9
|
"themeSelect.light": "라이트",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"sidebarNav.accessibleLabel": "메인",
|
|
14
14
|
"tableOfContents.onThisPage": "이 페이지에서는",
|
|
15
15
|
"tableOfContents.overview": "개요",
|
|
16
|
-
"i18n.untranslatedContent": "이
|
|
16
|
+
"i18n.untranslatedContent": "이 콘텐츠는 아직 해당 언어로 제공되지 않습니다.",
|
|
17
17
|
"page.editLink": "페이지 수정",
|
|
18
18
|
"page.lastUpdated": "마지막 업데이트:",
|
|
19
19
|
"page.previousLink": "이전",
|
|
20
20
|
"page.nextLink": "다음",
|
|
21
|
-
"page.draft": "
|
|
22
|
-
"404.text": "페이지를 찾을 수 없습니다. URL을 확인하거나
|
|
21
|
+
"page.draft": "이 콘텐츠는 초안이며 프로덕션 빌드에는 포함되지 않습니다.",
|
|
22
|
+
"404.text": "페이지를 찾을 수 없습니다. URL을 확인하거나 검색창을 사용해 보세요.",
|
|
23
23
|
"aside.note": "노트",
|
|
24
24
|
"aside.tip": "팁",
|
|
25
25
|
"aside.caution": "주의",
|
package/utils/routing/types.ts
CHANGED
|
@@ -67,8 +67,8 @@ export interface Route extends LocaleData {
|
|
|
67
67
|
slug: string;
|
|
68
68
|
/** The slug or unique ID if using the `legacy.collections` flag. */
|
|
69
69
|
id: string;
|
|
70
|
-
/**
|
|
71
|
-
isFallback?:
|
|
70
|
+
/** Whether this page is untranslated in the current language and using fallback content from the default locale. */
|
|
71
|
+
isFallback?: boolean;
|
|
72
72
|
[key: string]: unknown;
|
|
73
73
|
}
|
|
74
74
|
|
package/utils/starlight-page.ts
CHANGED
|
@@ -105,7 +105,7 @@ export async function generateStarlightPageRouteData({
|
|
|
105
105
|
props: StarlightPageProps;
|
|
106
106
|
url: URL;
|
|
107
107
|
}): Promise<StarlightRouteData> {
|
|
108
|
-
const {
|
|
108
|
+
const { frontmatter, ...routeProps } = props;
|
|
109
109
|
const slug = urlToSlug(url);
|
|
110
110
|
const pageFrontmatter = await getStarlightPageFrontmatter(frontmatter);
|
|
111
111
|
const id = project.legacyCollections ? `${stripLeadingAndTrailingSlashes(slug)}.md` : slug;
|
|
@@ -163,9 +163,6 @@ export async function generateStarlightPageRouteData({
|
|
|
163
163
|
slug,
|
|
164
164
|
}),
|
|
165
165
|
};
|
|
166
|
-
if (isFallback) {
|
|
167
|
-
routeData.isFallback = true;
|
|
168
|
-
}
|
|
169
166
|
return routeData;
|
|
170
167
|
}
|
|
171
168
|
|
package/utils/user-config.ts
CHANGED
|
@@ -233,6 +233,21 @@ const UserConfigSchema = z.object({
|
|
|
233
233
|
.transform((string) => [string])
|
|
234
234
|
.or(z.string().array())
|
|
235
235
|
.default([])
|
|
236
|
+
.superRefine((middlewares, ctx) => {
|
|
237
|
+
// Regex pattern to match invalid middleware paths: https://regex101.com/r/kQH7xm/2
|
|
238
|
+
const invalidPathRegex = /^\.?\/src\/middleware(?:\/index)?\.[jt]s$/;
|
|
239
|
+
const invalidPaths = middlewares.filter((middleware) => invalidPathRegex.test(middleware));
|
|
240
|
+
for (const invalidPath of invalidPaths) {
|
|
241
|
+
ctx.addIssue({
|
|
242
|
+
code: 'custom',
|
|
243
|
+
message:
|
|
244
|
+
`The \`"${invalidPath}"\` path in your Starlight \`routeMiddleware\` config conflicts with Astro’s middleware locations.\n\n` +
|
|
245
|
+
`You should rename \`${invalidPath}\` to something else like \`./src/starlightRouteData.ts\` and update the \`routeMiddleware\` file path to match.\n\n` +
|
|
246
|
+
'- More about Starlight route middleware: https://starlight.astro.build/guides/route-data/#how-to-customize-route-data\n' +
|
|
247
|
+
'- More about Astro middleware: https://docs.astro.build/en/guides/middleware/',
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
})
|
|
236
251
|
.describe('Add middleware to process Starlight’s route data for each page.'),
|
|
237
252
|
});
|
|
238
253
|
|