Skip to content

Commit d2a2056

Browse files
borlandclaude
andcommitted
Upgrade to Astro 7 and fix breaking changes
Bumps astro to ^7.0.9 and @astrojs/mdx to ^7.0.3, and resolves the breaking changes surfaced by the upgrade: - Header.astro: mark the theme-switcher <script> as `is:inline`. Astro 7 hands non-inline scripts to Vite for bundling, which cannot resolve the `/docs/js/modules/theme-switcher.js` public asset and failed the build. Inlining emits it verbatim so the browser resolves it at runtime. - astro.config.mjs: move remark plugins from the deprecated `markdown.remarkPlugins` into `markdown.processor: unified({ ... })` from @astrojs/markdown-remark (added as a direct dependency since it is now imported by the config). `trailingSlash` was not honored in its location, so it was removed, and drop the dead `extendDefaultPlugins`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 773caf5 commit d2a2056

4 files changed

Lines changed: 691 additions & 127 deletions

File tree

astro.config.mjs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import remarkDirective from 'remark-directive';
22
import remarkHeading from 'remark-heading-id';
33
import { defineConfig } from 'astro/config';
4+
import { unified } from '@astrojs/markdown-remark';
45
import mdx from '@astrojs/mdx';
56
import { attributeMarkdown, wrapTables } from '/src/themes/octopus/utilities/custom-markdown.mjs';
67
import llmMdEmitter from './src/integrations/llm-md-emitter.ts';
@@ -16,14 +17,14 @@ export default defineConfig({
1617
shikiConfig: {
1718
theme: 'light-plus'
1819
},
19-
remarkPlugins: [
20-
remarkDirective,
21-
remarkHeading,
22-
attributeMarkdown,
23-
wrapTables
24-
],
25-
trailingSlash: 'never',
26-
extendDefaultPlugins: true,
20+
processor: unified({
21+
remarkPlugins: [
22+
remarkDirective,
23+
remarkHeading,
24+
attributeMarkdown,
25+
wrapTables
26+
],
27+
}),
2728
},
2829
server: {
2930
port: 3000

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
"watch": "onchange 'src/**/*.{js,mjs,ts,astro,css}' 'public/docs/js/**/*.js' 'public/docs/css/**/*.css' -- prettier --write --plugin=prettier-plugin-astro {{changed}}"
2929
},
3030
"dependencies": {
31-
"@astrojs/mdx": "^5.0.4",
32-
"astro": "^6.3.1",
31+
"@astrojs/markdown-remark": "7.2.1",
32+
"@astrojs/mdx": "^7.0.3",
33+
"astro": "^7.0.9",
3334
"astro-accelerator-utils": "^0.3.84",
3435
"glob": "^13.0.6",
3536
"gray-matter": "^4.0.3",

0 commit comments

Comments
 (0)