@astrojs/starlight 0.34.4 → 0.34.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @astrojs/starlight
2
2
 
3
+ ## 0.34.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3293](https://github.com/withastro/starlight/pull/3293) [`88f0d34`](https://github.com/withastro/starlight/commit/88f0d349ee4e8c42bd38adc01031edf4c7b92342) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes an issue preventing to override the slug of a page with the [`slug` frontmatter property](https://starlight.astro.build/reference/frontmatter/#slug) using the `/` value.
8
+
9
+ ## 0.34.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [#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
14
+
15
+ - [#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.
16
+
3
17
  ## 0.34.4
4
18
 
5
19
  ### Patch Changes
@@ -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-bottom: 3vh;
66
+ padding: var(--sl-main-pad);
67
67
  }
68
68
  @media (min-width: 50em) {
69
69
  [data-has-sidebar] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/starlight",
3
- "version": "0.34.4",
3
+ "version": "0.34.6",
4
4
  "description": "Build beautiful, high-performance documentation websites with Astro",
5
5
  "keywords": [
6
6
  "docs",
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 */
@@ -18,13 +18,13 @@
18
18
  "page.lastUpdated": "Sidst opdateret:",
19
19
  "page.previousLink": "Forrige",
20
20
  "page.nextLink": "Næste",
21
- "page.draft": "This content is a draft and will not be included in production builds.",
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": "Caution",
26
- "aside.danger": "Danger",
27
- "fileTree.directory": "Directory",
28
- "builtWithStarlight.label": "Built with Starlight",
29
- "heading.anchorLabel": "Section titled “{{title}}”"
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/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.lang ?? config.defaultLocale.locale ?? BuiltInDefaultLocale.lang,
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/slugs.ts CHANGED
@@ -40,7 +40,7 @@ function localeToDir(locale: string | undefined): 'ltr' | 'rtl' {
40
40
  }
41
41
 
42
42
  export function slugToParam(slug: string): string | undefined {
43
- return slug === 'index' || slug === ''
43
+ return slug === 'index' || slug === '' || slug === '/'
44
44
  ? undefined
45
45
  : slug.endsWith('/index')
46
46
  ? slug.slice(0, -6)