@astrojs/starlight 0.34.0 → 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 CHANGED
@@ -1,5 +1,25 @@
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
+
15
+ ## 0.34.1
16
+
17
+ ### Patch Changes
18
+
19
+ - [#3140](https://github.com/withastro/starlight/pull/3140) [`f6eb1d5`](https://github.com/withastro/starlight/commit/f6eb1d5a776b007bec0f4b5fd7b160851daac9fc) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes a text selection issue for heading with a clickable anchor link when using double or triple click to select text.
20
+
21
+ - [#3148](https://github.com/withastro/starlight/pull/3148) [`dc8b6d5`](https://github.com/withastro/starlight/commit/dc8b6d5561eb90be9d31396ed1dc8f8258c9cbf7) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes a regression of the Starlight icon color when using the [`credits`](https://starlight.astro.build/reference/configuration/#credits) configuration option.
22
+
3
23
  ## 0.34.0
4
24
 
5
25
  ### Minor Changes
@@ -48,11 +48,14 @@ import { Icon } from '../components';
48
48
  text-decoration: none;
49
49
  color: var(--sl-color-gray-3);
50
50
  }
51
- .kudos :global(svg) {
52
- color: var(--sl-color-orange);
53
- }
54
51
  .kudos:hover {
55
52
  color: var(--sl-color-white);
56
53
  }
57
54
  }
55
+
56
+ @layer starlight.components {
57
+ .kudos :global(svg) {
58
+ color: var(--sl-color-orange);
59
+ }
60
+ }
58
61
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/starlight",
3
- "version": "0.34.0",
3
+ "version": "0.34.2",
4
4
  "description": "Build beautiful, high-performance documentation websites with Astro",
5
5
  "keywords": [
6
6
  "docs",
@@ -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
- await attachRouteDataAndRunMiddleware(Astro, await useRouteData(Astro));
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
  ---
@@ -88,6 +88,9 @@ how we do it.
88
88
  position: relative;
89
89
  /* Move the anchor link over the heading element’s end-of-line padding. */
90
90
  margin-inline-start: calc(-1 * var(--sl-anchor-icon-size));
91
+ /* Prevent double or triple clicks from potentially selecting the anchor link a11y text. */
92
+ -webkit-user-select: none;
93
+ user-select: none;
91
94
  }
92
95
 
93
96
  /* Increase clickable area for anchor links with a pseudo element that doesn’t impact layout. */
@@ -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
+ }
@@ -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
  );
@@ -56,6 +56,7 @@ const html = processFileTree(fileTreeHtml, Astro.locals.t('fileTree.directory'))
56
56
  }
57
57
 
58
58
  starlight-file-tree :global(.directory > details > summary:hover .highlight .tree-icon) {
59
+ color: var(--sl-color-text-invert);
59
60
  fill: currentColor;
60
61
  }
61
62
 
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
 
@@ -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, render } from 'astro:content';
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 useRouteData(context: APIContext): Promise<StarlightRouteData> {
29
- const route =
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
- const { Content, headings } = await render(route.entry);
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
  }