@astrojs/starlight 0.23.1 → 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,13 @@
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
+
3
11
  ## 0.23.1
4
12
 
5
13
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/starlight",
3
- "version": "0.23.1",
3
+ "version": "0.23.2",
4
4
  "description": "Build beautiful, high-performance documentation websites with Astro",
5
5
  "keywords": [
6
6
  "docs",
@@ -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