diff --git a/.changeset/kind-boats-train.md b/.changeset/kind-boats-train.md new file mode 100644 index 00000000000..83267d880ed --- /dev/null +++ b/.changeset/kind-boats-train.md @@ -0,0 +1,5 @@ +--- +'@astrojs/starlight': patch +--- + +Add Slack social link icon diff --git a/.changeset/polite-colts-turn.md b/.changeset/polite-colts-turn.md deleted file mode 100644 index 0e46da7f828..00000000000 --- a/.changeset/polite-colts-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/starlight': patch ---- - -Internal: fix import issue in translation string loading mechanism diff --git a/.changeset/quiet-humans-lie.md b/.changeset/quiet-humans-lie.md deleted file mode 100644 index 08611098bcc..00000000000 --- a/.changeset/quiet-humans-lie.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/starlight': patch ---- - -Fix last updated dates for pages displaying fallback content diff --git a/.prettierignore b/.prettierignore index 8b16453a2c2..871a65eb470 100644 --- a/.prettierignore +++ b/.prettierignore @@ -10,4 +10,7 @@ .changeset # Files -pnpm-lock.yaml \ No newline at end of file +pnpm-lock.yaml + +# Test snapshots +**/__tests__/**/snapshots diff --git a/docs/src/content/docs/reference/overrides.md b/docs/src/content/docs/reference/overrides.md index b3d95be95dd..a9938ad7f0d 100644 --- a/docs/src/content/docs/reference/overrides.md +++ b/docs/src/content/docs/reference/overrides.md @@ -342,6 +342,8 @@ The default implementation shows a large title, tagline, and call-to-action link Component rendered around each page’s main content. The default implementation sets up basic styles to apply to Markdown content. +The Markdown content styles are also exposed in `@astrojs/starlight/style/markdown.css` and scoped to the `.sl-markdown-content` CSS class. + --- ### Footer diff --git a/examples/basics/package.json b/examples/basics/package.json index b7a528788f1..926d71d4b80 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/starlight": "^0.12.0", + "@astrojs/starlight": "^0.12.1", "astro": "^3.2.3", "sharp": "^0.32.5" } diff --git a/examples/tailwind/package.json b/examples/tailwind/package.json index 25851c56001..35727482b5b 100644 --- a/examples/tailwind/package.json +++ b/examples/tailwind/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/starlight": "^0.12.0", + "@astrojs/starlight": "^0.12.1", "@astrojs/starlight-tailwind": "^2.0.1", "@astrojs/tailwind": "^5.0.0", "astro": "^3.2.3", diff --git a/packages/starlight/CHANGELOG.md b/packages/starlight/CHANGELOG.md index 901e1a813cb..01931083f14 100644 --- a/packages/starlight/CHANGELOG.md +++ b/packages/starlight/CHANGELOG.md @@ -1,5 +1,17 @@ # @astrojs/starlight +## 0.12.1 + +### Patch Changes + +- [#1069](https://github.com/withastro/starlight/pull/1069) [`b86f360`](https://github.com/withastro/starlight/commit/b86f3608f03be9455ec1d5ba11820c9bf601ad1e) Thanks [@Genteure](https://github.com/Genteure)! - Fix sidebar highlighting and navigation buttons for pages with path containing non-ASCII characters + +- [#1025](https://github.com/withastro/starlight/pull/1025) [`0d1e75e`](https://github.com/withastro/starlight/commit/0d1e75e17269ddac3eb15b7dfb4480da1bb01c6c) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Internal: fix import issue in translation string loading mechanism + +- [#1044](https://github.com/withastro/starlight/pull/1044) [`a5a9754`](https://github.com/withastro/starlight/commit/a5a9754f111b97abfd277d99759e9857aa0fb22b) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fix last updated dates for pages displaying fallback content + +- [#1049](https://github.com/withastro/starlight/pull/1049) [`c27495d`](https://github.com/withastro/starlight/commit/c27495da61f9376236519ed3f08a169f245a189c) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Expose Markdown content styles in `@astrojs/starlight/style/markdown.css` + ## 0.12.0 ### Minor Changes diff --git a/packages/starlight/__tests__/basics/sitemap.test.ts b/packages/starlight/__tests__/basics/sitemap.test.ts new file mode 100644 index 00000000000..d33820402be --- /dev/null +++ b/packages/starlight/__tests__/basics/sitemap.test.ts @@ -0,0 +1,40 @@ +import { describe, expect, test } from 'vitest'; +import { getSitemapConfig, starlightSitemap } from '../../integrations/sitemap'; +import type { StarlightConfig } from '../../types'; +import { StarlightConfigSchema, type StarlightUserConfig } from '../../utils/user-config'; + +describe('starlightSitemap', () => { + test('returns @astrojs/sitemap integration', () => { + const integration = starlightSitemap({} as StarlightConfig); + expect(integration.name).toBe('@astrojs/sitemap'); + }); +}); + +describe('getSitemapConfig', () => { + test('configures i18n config', () => { + const config = getSitemapConfig( + StarlightConfigSchema.parse({ + title: 'i18n test', + locales: { root: { lang: 'en', label: 'English' }, fr: { label: 'French' } }, + } satisfies StarlightUserConfig) + ); + expect(config).toMatchInlineSnapshot(` + { + "i18n": { + "defaultLocale": "root", + "locales": { + "fr": "fr", + "root": "en", + }, + }, + } + `); + }); + + test('no config for monolingual sites', () => { + const config = getSitemapConfig( + StarlightConfigSchema.parse({ title: 'i18n test' } satisfies StarlightUserConfig) + ); + expect(config).toMatchInlineSnapshot('{}'); + }); +}); diff --git a/packages/starlight/__tests__/remark-rehype/asides.test.ts b/packages/starlight/__tests__/remark-rehype/asides.test.ts new file mode 100644 index 00000000000..7d1da5a6781 --- /dev/null +++ b/packages/starlight/__tests__/remark-rehype/asides.test.ts @@ -0,0 +1,87 @@ +import { createMarkdownProcessor } from '@astrojs/markdown-remark'; +import { describe, expect, test } from 'vitest'; +import { starlightAsides } from '../../integrations/asides'; + +const processor = await createMarkdownProcessor({ + remarkPlugins: [...starlightAsides()], +}); + +test('generates