Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/kind-ravens-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astrojs/starlight': minor
---

Updates the `astro-expressive-code` dependency to the latest version (0.38).

The new version allows using `ec.config.mjs` to selectively override individual Expressive Code styles and settings provided by Starlight themes and plugins, speeds up Shiki language loading, and adds the config option `expressiveCode.shiki.injectLangsIntoNestedCodeBlocks`. See the [Expressive Code release notes](https://expressive-code.com/releases/#0380) for full details.
7 changes: 5 additions & 2 deletions packages/starlight/integrations/expressive-code/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { addClassName } from 'astro-expressive-code/hast';
import type { AstroIntegration } from 'astro';
import type { StarlightConfig } from '../../types';
import type { createTranslationSystemFromFs } from '../../utils/translations-fs';
import { pathToLocale } from '../shared/pathToLocale';
import { pathToLocale, slugToLocale } from '../shared/pathToLocale';
import {
applyStarlightUiThemeColors,
preprocessThemes,
Expand Down Expand Up @@ -152,7 +152,10 @@ export function getStarlightEcConfigPreprocessor({
},
...otherStyleOverrides,
},
getBlockLocale: ({ file }) => pathToLocale(file.path, { starlightConfig, astroConfig }),
getBlockLocale: ({ file }) =>
file.url
? slugToLocale(file.url.pathname.slice(1), starlightConfig.locales)
: pathToLocale(file.path, { starlightConfig, astroConfig }),
plugins,
...rest,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/integrations/shared/pathToLocale.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { AstroConfig } from 'astro';
import type { StarlightConfig } from '../../types';

function slugToLocale(
export function slugToLocale(
slug: string | undefined,
localesConfig: StarlightConfig['locales']
): string | undefined {
Expand Down
6 changes: 3 additions & 3 deletions packages/starlight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,16 @@
"@types/node": "^18.16.19",
"@vitest/coverage-v8": "^1.6.0",
"astro": "^4.15.3",
"vitest": "^1.6.0",
"linkedom": "^0.18.4"
"linkedom": "^0.18.4",
"vitest": "^1.6.0"
},
"dependencies": {
"@astrojs/mdx": "^3.1.3",
"@astrojs/sitemap": "^3.1.6",
"@pagefind/default-ui": "^1.0.3",
"@types/hast": "^3.0.4",
"@types/mdast": "^4.0.4",
"astro-expressive-code": "^0.35.6",
"astro-expressive-code": "^0.38.2",
"bcp-47": "^2.1.0",
"hast-util-from-html": "^2.0.1",
"hast-util-select": "^6.0.2",
Expand Down
130 changes: 102 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading