@astrojs/starlight 0.34.1 → 0.34.2
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 +12 -0
- package/package.json +1 -1
- package/routes/common.astro +14 -2
- package/translations/hu.json +43 -0
- package/translations/index.ts +2 -0
- package/user-components/FileTree.astro +1 -0
- package/utils/git.ts +7 -0
- package/utils/routing/data.ts +12 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @astrojs/starlight
|
|
2
2
|
|
|
3
|
+
## 0.34.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#3153](https://github.com/withastro/starlight/pull/3153) [`ea31f46`](https://github.com/withastro/starlight/commit/ea31f46be4d43339417dac7fc135d2be97080c58) Thanks [@SuperKXT](https://github.com/SuperKXT)! - Fixes hover styles for highlighted directory in FileTree component.
|
|
8
|
+
|
|
9
|
+
- [#2905](https://github.com/withastro/starlight/pull/2905) [`b5232bc`](https://github.com/withastro/starlight/commit/b5232bcd201c2e3904bde2d7717fe6cfa06d6c82) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes a potential issue for projects with dynamic routes added by an user, an Astro integration, or a Starlight plugin where some styles could end up being missing.
|
|
10
|
+
|
|
11
|
+
- [#3165](https://github.com/withastro/starlight/pull/3165) [`80a7871`](https://github.com/withastro/starlight/commit/80a7871ccad17aef8567a416a419669de6d5d3fd) Thanks [@KianNH](https://github.com/KianNH)! - Increases `maxBuffer` for an internal `spawnSync()` call to support larger Git commit histories when using Starlight's [`lastUpdated`](https://starlight.astro.build/reference/configuration/#lastupdated) feature.
|
|
12
|
+
|
|
13
|
+
- [#3158](https://github.com/withastro/starlight/pull/3158) [`d1f3c8b`](https://github.com/withastro/starlight/commit/d1f3c8b6583b93968af3c568f7af44b1b10326ec) Thanks [@heisenberg0924](https://github.com/heisenberg0924)! - Adds Hungarian language support
|
|
14
|
+
|
|
3
15
|
## 0.34.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/package.json
CHANGED
package/routes/common.astro
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
---
|
|
2
|
+
import { render } from 'astro:content';
|
|
2
3
|
import Page from '../components/Page.astro';
|
|
3
|
-
import { useRouteData } from '../utils/routing/data';
|
|
4
|
+
import { getRoute, useRouteData } from '../utils/routing/data';
|
|
4
5
|
import { attachRouteDataAndRunMiddleware } from '../utils/routing/middleware';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
const route = await getRoute(Astro);
|
|
8
|
+
/**
|
|
9
|
+
* The call to `render` from `astro:content` is purposely made in this file to work around a
|
|
10
|
+
* development mode head propagation issue which is heavily tied to `astro:content` imports. Even
|
|
11
|
+
* though we have a test for this, refactoring and moving this code to a different file should be
|
|
12
|
+
* avoided for now until the linked issue which also contains more details is resolved.
|
|
13
|
+
*
|
|
14
|
+
* @see https://github.com/withastro/astro/issues/13724
|
|
15
|
+
*/
|
|
16
|
+
const renderResult = await render(route.entry);
|
|
17
|
+
|
|
18
|
+
await attachRouteDataAndRunMiddleware(Astro, await useRouteData(Astro, route, renderResult));
|
|
7
19
|
|
|
8
20
|
const { Content, entry } = Astro.locals.starlightRoute;
|
|
9
21
|
---
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skipLink.label": "Tovább a tartalomhoz",
|
|
3
|
+
"search.label": "Keresés",
|
|
4
|
+
"search.ctrlKey": "Ctrl",
|
|
5
|
+
"search.cancelLabel": "Mégsem",
|
|
6
|
+
"search.devWarning": "A keresés csak a production build-ekben működik. \nPróbáld meg először buildelni, hogy kipróbálhasd.",
|
|
7
|
+
"themeSelect.accessibleLabel": "Téma választás",
|
|
8
|
+
"themeSelect.dark": "Sötét",
|
|
9
|
+
"themeSelect.light": "Világos",
|
|
10
|
+
"themeSelect.auto": "Auto",
|
|
11
|
+
"languageSelect.accessibleLabel": "Nyelv választása",
|
|
12
|
+
"menuButton.accessibleLabel": "Menü",
|
|
13
|
+
"sidebarNav.accessibleLabel": "Fő",
|
|
14
|
+
"tableOfContents.onThisPage": "Ezen az oldalon",
|
|
15
|
+
"tableOfContents.overview": "Tartalom",
|
|
16
|
+
"i18n.untranslatedContent": "Ez a tartalom még nem érhető el a jelenlegi nyelven.",
|
|
17
|
+
"page.editLink": "Oldal szerkesztése",
|
|
18
|
+
"page.lastUpdated": "Utoljára frissítve:",
|
|
19
|
+
"page.previousLink": "Előző",
|
|
20
|
+
"page.nextLink": "Következő",
|
|
21
|
+
"page.draft": "Ez a tartalom még vázlat, így nem lesz benne a production build-ben.",
|
|
22
|
+
"404.text": "Az oldal nem található. Nézd meg az URL-t vagy használd a keresőt.",
|
|
23
|
+
"aside.note": "Megjegyzés",
|
|
24
|
+
"aside.tip": "Tipp",
|
|
25
|
+
"aside.caution": "Figyelem",
|
|
26
|
+
"aside.danger": "Veszély",
|
|
27
|
+
"fileTree.directory": "Könyvtár",
|
|
28
|
+
"builtWithStarlight.label": "Starlight-tal készítve",
|
|
29
|
+
"heading.anchorLabel": "Szekció neve “{{title}}”",
|
|
30
|
+
"expressiveCode.copyButtonCopied": "Másolva!",
|
|
31
|
+
"expressiveCode.copyButtonTooltip": "Másolás",
|
|
32
|
+
"expressiveCode.terminalWindowFallbackTitle": "Terminál",
|
|
33
|
+
"pagefind.clear_search": "Törlés",
|
|
34
|
+
"pagefind.load_more": "Több találat betöltése",
|
|
35
|
+
"pagefind.search_label": "Keresés ezen az oldalon",
|
|
36
|
+
"pagefind.filters_label": "Szűrők",
|
|
37
|
+
"pagefind.zero_results": "Erre a kifejezésre nincs találat: [SEARCH_TERM]",
|
|
38
|
+
"pagefind.many_results": "[COUNT] találat erre: [SEARCH_TERM]",
|
|
39
|
+
"pagefind.one_result": "[COUNT] találat erre: [SEARCH_TERM]",
|
|
40
|
+
"pagefind.alt_search": "Erre a kifejezésre nincs találat: [SEARCH_TERM]. Találatok mutatása erre: [DIFFERENT_TERM]",
|
|
41
|
+
"pagefind.search_suggestion": "Erre a kifejezésre nincs találat: [SEARCH_TERM]. Próbáld meg ezek közül az egyiket:",
|
|
42
|
+
"pagefind.searching": "Keresés erre: [SEARCH_TERM]..."
|
|
43
|
+
}
|
package/translations/index.ts
CHANGED
|
@@ -29,6 +29,7 @@ import zhTW from './zh-TW.json';
|
|
|
29
29
|
import pl from './pl.json';
|
|
30
30
|
import sk from './sk.json';
|
|
31
31
|
import lv from './lv.json';
|
|
32
|
+
import hu from './hu.json';
|
|
32
33
|
|
|
33
34
|
const { parse } = builtinI18nSchema();
|
|
34
35
|
|
|
@@ -64,5 +65,6 @@ export default Object.fromEntries(
|
|
|
64
65
|
pl,
|
|
65
66
|
sk,
|
|
66
67
|
lv,
|
|
68
|
+
hu,
|
|
67
69
|
}).map(([key, dict]) => [key, parse(dict)])
|
|
68
70
|
);
|
package/utils/git.ts
CHANGED
|
@@ -72,6 +72,13 @@ export function getAllNewestCommitDate(rootPath: string, docsPath: string): [str
|
|
|
72
72
|
{
|
|
73
73
|
cwd: repoRoot,
|
|
74
74
|
encoding: 'utf-8',
|
|
75
|
+
// The default `maxBuffer` for `spawnSync` is 1024 * 1024 bytes, a.k.a 1 MB. In big projects,
|
|
76
|
+
// the full git history can be larger than this, so we increase this to ~10 MB. For example,
|
|
77
|
+
// Cloudflare passed 1 MB with ~4,800 pages and ~17,000 commits. If we get reports of others
|
|
78
|
+
// hitting ENOBUFS errors here in the future, we may want to switch to streaming the git log
|
|
79
|
+
// with `spawn` instead.
|
|
80
|
+
// See https://github.com/withastro/starlight/issues/3154
|
|
81
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
75
82
|
}
|
|
76
83
|
);
|
|
77
84
|
|
package/utils/routing/data.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type {
|
|
|
15
15
|
import { formatPath } from '../format-path';
|
|
16
16
|
import { useTranslations } from '../translations';
|
|
17
17
|
import { BuiltInDefaultLocale } from '../i18n';
|
|
18
|
-
import { getEntry,
|
|
18
|
+
import { getEntry, type RenderResult } from 'astro:content';
|
|
19
19
|
import { getCollectionPathFromRoot } from '../collection';
|
|
20
20
|
import { getHead } from '../head';
|
|
21
21
|
|
|
@@ -25,11 +25,18 @@ export interface PageProps extends Route {
|
|
|
25
25
|
|
|
26
26
|
export type RouteDataContext = Pick<APIContext, 'generator' | 'site' | 'url'>;
|
|
27
27
|
|
|
28
|
-
export async function
|
|
29
|
-
|
|
28
|
+
export async function getRoute(context: APIContext): Promise<Route> {
|
|
29
|
+
return (
|
|
30
30
|
('slug' in context.params && getRouteBySlugParam(context.params.slug)) ||
|
|
31
|
-
(await get404Route(context.locals))
|
|
32
|
-
|
|
31
|
+
(await get404Route(context.locals))
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export async function useRouteData(
|
|
36
|
+
context: APIContext,
|
|
37
|
+
route: Route,
|
|
38
|
+
{ Content, headings }: RenderResult
|
|
39
|
+
): Promise<StarlightRouteData> {
|
|
33
40
|
const routeData = generateRouteData({ props: { ...route, headings }, context });
|
|
34
41
|
return { ...routeData, Content };
|
|
35
42
|
}
|