@astrojs/starlight 0.11.1 → 0.11.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,19 @@
1
1
  # @astrojs/starlight
2
2
 
3
+ ## 0.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#944](https://github.com/withastro/starlight/pull/944) [`7a6446e`](https://github.com/withastro/starlight/commit/7a6446ebc61ba9cc36d1dcfd13db15c1533751ab) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fix issue with sidebar autogenerated groups configured with a directory containing leading or trailing slash
8
+
9
+ - [#985](https://github.com/withastro/starlight/pull/985) [`92b3b57`](https://github.com/withastro/starlight/commit/92b3b575404d0dc34f720c0ba29d8ed50be98f58) Thanks [@delucis](https://github.com/delucis)! - Fix edit URLs for pages displaying fallback content
10
+
11
+ - [#986](https://github.com/withastro/starlight/pull/986) [`0470734`](https://github.com/withastro/starlight/commit/0470734e0dc323f9945e06bee4338c2f777ba0d6) Thanks [@dreyfus92](https://github.com/dreyfus92)! - Prevent overscrolling on mobile table of contents by setting 'overscroll-behavior: contain'.
12
+
13
+ - [#924](https://github.com/withastro/starlight/pull/924) [`39d6302`](https://github.com/withastro/starlight/commit/39d6302db42ee1105d690bbd3a66053e6b21e15a) Thanks [@kevinzunigacuellar](https://github.com/kevinzunigacuellar)! - Remove extra margin from markdown lists that uses inline code
14
+
15
+ - [#814](https://github.com/withastro/starlight/pull/814) [`1e517d9`](https://github.com/withastro/starlight/commit/1e517d92a4cf146d2dcae58f7c4299d6f25ea73e) Thanks [@julien-deramond](https://github.com/julien-deramond)! - Prevent text from overflowing pagination items
16
+
3
17
  ## 0.11.1
4
18
 
5
19
  ### Patch Changes
@@ -7,8 +7,8 @@ import type { Props } from '../props';
7
7
  <style>
8
8
  .content
9
9
  :global(
10
- :not(a, strong, em, del, span, input)
11
- + :not(a, strong, em, del, span, input, :where(.not-content *))
10
+ :not(a, strong, em, del, span, input, code)
11
+ + :not(a, strong, em, del, span, input, code, :where(.not-content *))
12
12
  ) {
13
13
  margin-top: 1.5rem;
14
14
  }
@@ -105,6 +105,7 @@ const t = useTranslations(locale);
105
105
  overflow-y: auto;
106
106
  background-color: var(--sl-color-black);
107
107
  box-shadow: var(--sl-shadow-md);
108
+ overscroll-behavior: contain;
108
109
  }
109
110
  </style>
110
111
 
@@ -9,7 +9,7 @@ const isRtl = dir === 'rtl';
9
9
  const t = useTranslations(locale);
10
10
  ---
11
11
 
12
- <div class="pagination-links sl-flex" dir={dir}>
12
+ <div class="pagination-links" dir={dir}>
13
13
  {
14
14
  prev && (
15
15
  <a href={prev.href} rel="prev">
@@ -38,7 +38,8 @@ const t = useTranslations(locale);
38
38
 
39
39
  <style>
40
40
  .pagination-links {
41
- flex-wrap: wrap;
41
+ display: grid;
42
+ grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
42
43
  gap: 1rem;
43
44
  }
44
45
 
@@ -56,6 +57,7 @@ const t = useTranslations(locale);
56
57
  text-decoration: none;
57
58
  color: var(--sl-color-gray-2);
58
59
  box-shadow: var(--sl-shadow-md);
60
+ overflow-wrap: anywhere;
59
61
  }
60
62
  [rel='next'] {
61
63
  justify-content: end;
@@ -71,4 +73,8 @@ const t = useTranslations(locale);
71
73
  font-size: var(--sl-text-2xl);
72
74
  line-height: var(--sl-line-height-headings);
73
75
  }
76
+
77
+ svg {
78
+ flex-shrink: 0;
79
+ }
74
80
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/starlight",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "Build beautiful, high-performance documentation websites with Astro",
5
5
  "keywords": [
6
6
  "docs",
@@ -2,6 +2,7 @@ import type { AstroBuiltinAttributes } from 'astro';
2
2
  import type { HTMLAttributes } from 'astro/types';
3
3
  import { z } from 'astro/zod';
4
4
  import { BadgeConfigSchema } from './badge';
5
+ import { stripLeadingAndTrailingSlashes } from '../utils/path';
5
6
 
6
7
  const SidebarBaseSchema = z.object({
7
8
  /** The visible label for this item in the sidebar. */
@@ -39,7 +40,7 @@ const AutoSidebarGroupSchema = SidebarGroupSchema.extend({
39
40
  /** Enable autogenerating a sidebar category from a specific docs directory. */
40
41
  autogenerate: z.object({
41
42
  /** The directory to generate sidebar items for. */
42
- directory: z.string(),
43
+ directory: z.string().transform(stripLeadingAndTrailingSlashes),
43
44
  /**
44
45
  * Whether the autogenerated subgroups should be collapsed by default.
45
46
  * Defaults to the `AutoSidebarGroup` `collapsed` value.
package/schemas/social.ts CHANGED
@@ -1,33 +1,35 @@
1
1
  import { z } from 'astro/zod';
2
2
 
3
+ export const socialLinks = [
4
+ 'twitter',
5
+ 'mastodon',
6
+ 'github',
7
+ 'gitlab',
8
+ 'bitbucket',
9
+ 'discord',
10
+ 'gitter',
11
+ 'codeberg',
12
+ 'codePen',
13
+ 'youtube',
14
+ 'threads',
15
+ 'linkedin',
16
+ 'twitch',
17
+ 'microsoftTeams',
18
+ 'instagram',
19
+ 'stackOverflow',
20
+ 'x.com',
21
+ 'telegram',
22
+ 'rss',
23
+ 'facebook',
24
+ 'email',
25
+ 'reddit',
26
+ 'patreon',
27
+ ] as const;
28
+
3
29
  export const SocialLinksSchema = () =>
4
30
  z
5
31
  .record(
6
- z.enum([
7
- 'twitter',
8
- 'mastodon',
9
- 'github',
10
- 'gitlab',
11
- 'bitbucket',
12
- 'discord',
13
- 'gitter',
14
- 'codeberg',
15
- 'codePen',
16
- 'youtube',
17
- 'threads',
18
- 'linkedin',
19
- 'twitch',
20
- 'microsoftTeams',
21
- 'instagram',
22
- 'stackOverflow',
23
- 'x.com',
24
- 'telegram',
25
- 'rss',
26
- 'facebook',
27
- 'email',
28
- 'reddit',
29
- 'patreon',
30
- ]),
32
+ z.enum(socialLinks),
31
33
  // Link to the respective social profile for this site
32
34
  z.string().url()
33
35
  )
@@ -5,9 +5,10 @@ import config from 'virtual:starlight/user-config';
5
5
  import { generateToC, type TocItem } from './generateToC';
6
6
  import { getFileCommitDate } from './git';
7
7
  import { getPrevNextLinks, getSidebar, type SidebarEntry } from './navigation';
8
+ import { ensureTrailingSlash } from './path';
8
9
  import type { Route } from './routing';
10
+ import { localizedId } from './slugs';
9
11
  import { useTranslations } from './translations';
10
- import { ensureTrailingSlash } from './path';
11
12
 
12
13
  interface PageProps extends Route {
13
14
  headings: MarkdownHeading[];
@@ -79,7 +80,7 @@ function getLastUpdated({ entry, id }: PageProps): Date | undefined {
79
80
  return;
80
81
  }
81
82
 
82
- function getEditUrl({ entry, id }: PageProps): URL | undefined {
83
+ function getEditUrl({ entry, id, isFallback }: PageProps): URL | undefined {
83
84
  const { editUrl } = entry.data;
84
85
  // If frontmatter value is false, editing is disabled for this page.
85
86
  if (editUrl === false) return;
@@ -90,8 +91,9 @@ function getEditUrl({ entry, id }: PageProps): URL | undefined {
90
91
  url = editUrl;
91
92
  } else if (config.editLink.baseUrl) {
92
93
  const srcPath = project.srcDir.replace(project.root, '');
94
+ const filePath = isFallback ? localizedId(id, config.defaultLocale.locale) : id;
93
95
  // If a base URL was added in Starlight config, synthesize the edit URL from it.
94
- url = ensureTrailingSlash(config.editLink.baseUrl) + srcPath + 'content/docs/' + id;
96
+ url = ensureTrailingSlash(config.editLink.baseUrl) + srcPath + 'content/docs/' + filePath;
95
97
  }
96
98
  return url ? new URL(url) : undefined;
97
99
  }
@@ -1,6 +1,5 @@
1
1
  import { z } from 'astro/zod';
2
2
  import { parse as bcpParse, stringify as bcpStringify } from 'bcp-47';
3
- import { BadgeConfigSchema } from '../schemas/badge';
4
3
  import { ComponentConfigSchema } from '../schemas/components';
5
4
  import { FaviconSchema } from '../schemas/favicon';
6
5
  import { HeadConfigSchema } from '../schemas/head';