@astrojs/starlight 0.23.0 → 0.23.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.23.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1913](https://github.com/withastro/starlight/pull/1913) [`7ebe8f75`](https://github.com/withastro/starlight/commit/7ebe8f7599d473cdd22c80bb0fe115fe6120cab7) Thanks [@delucis](https://github.com/delucis)! - Fixes support for Astro’s `build: { format: 'preserve' }` configuration option
8
+
9
+ - [#1941](https://github.com/withastro/starlight/pull/1941) [`2f3240c9`](https://github.com/withastro/starlight/commit/2f3240c91c09dfc411d93a71eeb75ad6d704e14b) Thanks [@astrobot-houston](https://github.com/astrobot-houston)! - Adds icon support for `.otf` files in `<FileTree>`
10
+
11
+ ## 0.23.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#1892](https://github.com/withastro/starlight/pull/1892) [`01de9be8`](https://github.com/withastro/starlight/commit/01de9be89c85bcd0022e87465182ee1aba501687) Thanks [@delucis](https://github.com/delucis)! - Internal refactor: simplify some CSS for the `<details>` element
16
+
3
17
  ## 0.23.0
4
18
 
5
19
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/starlight",
3
- "version": "0.23.0",
3
+ "version": "0.23.2",
4
4
  "description": "Build beautiful, high-performance documentation websites with Astro",
5
5
  "keywords": [
6
6
  "docs",
@@ -121,13 +121,14 @@
121
121
  /* <details> and <summary> styles */
122
122
  .sl-markdown-content details:not(:where(.not-content *)) {
123
123
  --sl-details-border-color: var(--sl-color-gray-5);
124
+ --sl-details-border-color--hover: var(--sl-color-text-accent);
124
125
 
125
126
  border-inline-start: 2px solid var(--sl-details-border-color);
126
127
  padding-inline-start: 1rem;
127
128
  }
128
129
  .sl-markdown-content details:not([open]):hover:not(:where(.not-content *)),
129
130
  .sl-markdown-content details:has(> summary:hover):not(:where(.not-content *)) {
130
- --sl-details-border-color: var(--sl-color-text-accent);
131
+ border-color: var(--sl-details-border-color--hover);
131
132
  }
132
133
  .sl-markdown-content summary:not(:where(.not-content *)) {
133
134
  color: var(--sl-color-white);
@@ -182,8 +183,5 @@
182
183
  /* <details> styles inside asides */
183
184
  .sl-markdown-content .starlight-aside details:not(:where(.not-content *)) {
184
185
  --sl-details-border-color: var(--sl-color-asides-border);
185
- }
186
- .sl-markdown-content .starlight-aside details:not([open]):hover:not(:where(.not-content *)),
187
- .sl-markdown-content .starlight-aside details:has(> summary:hover):not(:where(.not-content *)) {
188
- --sl-details-border-color: var(--sl-color-asides-text-accent);
186
+ --sl-details-border-color--hover: var(--sl-color-asides-text-accent);
189
187
  }
@@ -340,6 +340,7 @@ export const definitions: Definitions = {
340
340
  '.ttf': 'seti:font',
341
341
  '.woff': 'seti:font',
342
342
  '.woff2': 'seti:font',
343
+ '.otf': 'seti:font',
343
344
  '.avif': 'seti:image',
344
345
  '.gif': 'seti:image',
345
346
  '.jpg': 'seti:image',
@@ -12,15 +12,18 @@ interface FormatPathOptions {
12
12
  trailingSlash?: AstroConfig['trailingSlash'];
13
13
  }
14
14
 
15
+ const defaultFormatStrategy = {
16
+ addBase: pathWithBase,
17
+ handleExtension: (href: string) => stripHtmlExtension(href),
18
+ };
19
+
15
20
  const formatStrategies = {
16
21
  file: {
17
22
  addBase: fileWithBase,
18
23
  handleExtension: (href: string) => ensureHtmlExtension(href),
19
24
  },
20
- directory: {
21
- addBase: pathWithBase,
22
- handleExtension: (href: string) => stripHtmlExtension(href),
23
- },
25
+ directory: defaultFormatStrategy,
26
+ preserve: defaultFormatStrategy,
24
27
  };
25
28
 
26
29
  const trailingSlashStrategies = {
@@ -34,7 +37,6 @@ function formatPath(
34
37
  href: string,
35
38
  { format = 'directory', trailingSlash = 'ignore' }: FormatPathOptions
36
39
  ) {
37
- // @ts-expect-error — TODO: add support for `preserve` (https://github.com/withastro/starlight/issues/1781)
38
40
  const formatStrategy = formatStrategies[format];
39
41
  const trailingSlashStrategy = trailingSlashStrategies[trailingSlash];
40
42