Skip to content

Commit 84f8780

Browse files
committed
Merge branch 'main' into support-custom-icons
* main: Exclude banner content from Pagefind indexing (#3276) Restrict remark/rehype plugins usage (#3274) [ci] release (#3307) Fix Astro i18n default locale regression (#3306) i18n(de): translate `plugins.mdx` and `community-content.mdx` (#3304)
2 parents 84f4c63 + 3917b20 commit 84f8780

26 files changed

Lines changed: 275 additions & 31 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/starlight': patch
3+
---
4+
5+
Prevents Starlight remark and rehype plugins from transforming Markdown and MDX content when using the Astro [`renderMarkdown()`](https://docs.astro.build/en/reference/content-loader-reference/#rendermarkdown) content loader API.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@astrojs/starlight': minor
3+
---
4+
5+
Excludes banner content from search results
6+
7+
Previously, content set in [`banner`](https://starlight.astro.build/reference/frontmatter/#banner) in page frontmatter was indexed by Starlight’s default search provider Pagefind. This could cause unexpected search results, especially for sites setting a common banner content on multiple pages. Starlight’s default `Banner` component is now excluded from search indexing.
8+
9+
This change does not impact `Banner` overrides using custom components.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@astrojs/starlight': minor
3+
---
4+
5+
Fixes an issue where some Starlight remark and rehype plugins were transforming Markdown and MDX content in non-Starlight pages.
6+
7+
⚠️ **BREAKING CHANGE:**
8+
9+
Previously, some of Starlight’s remark and rehype plugins, most notably the plugin transforming Starlight's custom Markdown syntax for [rendering asides](https://starlight.astro.build/guides/authoring-content/#asides), were applied to all Markdown and MDX content. This included content from [individual Markdown pages](https://docs.astro.build/en/guides/markdown-content/#individual-markdown-pages) and content from [content collections](https://docs.astro.build/en/guides/content-collections/) other than the `docs` collection used by Starlight.
10+
11+
This change restricts the application of Starlight’s remark and rehype plugins to only Markdown and MDX content loaded using Starlight's [`docsLoader()`](https://starlight.astro.build/reference/configuration/#docsloader). If you were relying on this behavior, please let us know about your use case in the dedicated `#starlight` channel in the [Astro Discord](https://astro.build/chat/) or by [opening an issue](https://github.com/withastro/starlight/issues/new?template=---01-bug-report.yml).

docs/src/content/docs/de/resources/community-content.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ Erkunde die von der Community erstellten Inhalte, die von Starlight-Benutzern ge
109109
title="Starlight Beispiele"
110110
description="Eine Sammlung von StackBlitz-Einbettungen, die zeigen, wie man in Starlight-Dokumentations­websites praktische Dinge tun kann."
111111
/>
112+
<LinkCard
113+
href="https://hideoo.dev/notebooks/starlight-plugins-by-example"
114+
title="Starlight-Plugins anhand von Beispielen"
115+
description="Eine Sammlung von Notizen und Beispielen zu Starlight-Plugins und gängigen Mustern, die zum Erstellen dieser Plugins verwendet werden."
116+
/>
112117
</CardGrid>
113118

114119
## Video-Inhalte

docs/src/content/docs/de/resources/plugins.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,9 @@ Diese Community-Tools und Integrationen können verwendet werden, um deiner Star
222222
title="astro-mermaid"
223223
description="Rendere Mermaid-Inhalte in Markdown-Code-Blöcken auf der Client-Seite."
224224
/>
225+
<LinkCard
226+
href="https://github.com/HiDeoo/astro-d2"
227+
title="astro-d2"
228+
description="D2 Markdown-Code-Blöcke in Diagramme umwandeln."
229+
/>
225230
</CardGrid>

examples/basics/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"astro": "astro"
1212
},
1313
"dependencies": {
14-
"@astrojs/starlight": "^0.34.7",
14+
"@astrojs/starlight": "^0.34.8",
1515
"astro": "^5.6.1",
1616
"sharp": "^0.34.2"
1717
}

examples/markdoc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@astrojs/markdoc": "^0.13.3",
15-
"@astrojs/starlight": "^0.34.7",
15+
"@astrojs/starlight": "^0.34.8",
1616
"@astrojs/starlight-markdoc": "^0.4.0",
1717
"astro": "^5.6.1",
1818
"sharp": "^0.34.2"

examples/tailwind/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"astro": "astro"
1212
},
1313
"dependencies": {
14-
"@astrojs/starlight": "^0.34.7",
14+
"@astrojs/starlight": "^0.34.8",
1515
"@astrojs/starlight-tailwind": "^4.0.1",
1616
"@tailwindcss/vite": "^4.0.7",
1717
"astro": "^5.6.1",

packages/starlight/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @astrojs/starlight
22

3+
## 0.34.8
4+
5+
### Patch Changes
6+
7+
- [#3306](https://github.com/withastro/starlight/pull/3306) [`21fcd94`](https://github.com/withastro/starlight/commit/21fcd944d528557b89fc8b351579beabdcc06ff6) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes a regression in Starlight version `0.34.5` that caused multilingual sites with a default locale explicitly set to `root` to report a configuration error.
8+
39
## 0.34.7
410

511
### Patch Changes

packages/starlight/__e2e__/components.test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,41 @@ test.describe('anchor headings', () => {
408408
});
409409
});
410410

411+
test.describe('asides', () => {
412+
test('does not render Markdown asides for individual Markdown pages and entries not part of the `docs` collection', async ({
413+
getProdServer,
414+
page,
415+
}) => {
416+
const starlight = await getProdServer();
417+
418+
// Individual Markdown page
419+
await starlight.goto('/markdown-page');
420+
await expect(page.locator('.starlight-aside')).not.toBeAttached();
421+
await page.pause();
422+
423+
// Content entry from the `reviews` content collection
424+
await starlight.goto('/reviews/alice');
425+
await expect(page.locator('.starlight-aside')).not.toBeAttached();
426+
});
427+
});
428+
429+
test.describe('RTL support', () => {
430+
test('does not add RTL support to code and preformatted text elements for individual Markdown pages and entries not part of the `docs` collection', async ({
431+
getProdServer,
432+
page,
433+
}) => {
434+
const starlight = await getProdServer();
435+
436+
// Individual Markdown page
437+
await starlight.goto('/markdown-page');
438+
await expect(page.locator('code[dir="auto"]')).not.toBeAttached();
439+
440+
// Content entry from the `reviews` content collection
441+
await starlight.goto('/reviews/alice');
442+
await expect(page.locator('code[dir="auto"]')).not.toBeAttached();
443+
});
444+
});
445+
411446
test.describe('head propagation', () => {
412447
/**
413448
* Due to a head propagation issue in development mode, dynamic routes alphabetically sorted

0 commit comments

Comments
 (0)