Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
15 changes: 11 additions & 4 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import starlight from '@astrojs/starlight';
import { pluginCollapsibleSections } from '@expressive-code/plugin-collapsible-sections';
import xmdx from 'astro-xmdx';
import { starlightPreset } from 'astro-xmdx/presets';
import { defineConfig, sharpImageService } from 'astro/config';
import rehypeSlug from 'rehype-slug';
import remarkSmartypants from 'remark-smartypants';
Expand Down Expand Up @@ -28,9 +29,6 @@ export default defineConfig({
]),
starlight({
title: 'Docs',
expressiveCode: {
plugins: [pluginCollapsibleSections()],
},
components: {
EditLink: './src/components/starlight/EditLink.astro',
Hero: './src/components/starlight/Hero.astro',
Expand Down Expand Up @@ -72,6 +70,10 @@ export default defineConfig({
plugins: [starlightPluginSmokeTest(), starlightPluginLlmsTxt()],
}),
sitemap(),
xmdx({
presets: [starlightPreset({ expressiveCode: false })],
expressiveCode: { enabled: true, importSource: '@astrojs/starlight/components' },
}),
],
trailingSlash: 'always',
scopedStyleStrategy: 'where',
Expand All @@ -95,4 +97,9 @@ export default defineConfig({
domains: ['avatars.githubusercontent.com'],
service: sharpImageService(),
},
vite: {
ssr: {
noExternal: ['xmdx'],
},
},
});
3 changes: 3 additions & 0 deletions config/plugins/llms-txt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import starlightLlmsTxt from 'starlight-llms-txt';
/** Starlight plugin that sets up `starlight-llms-txt` with configuration for the Astro docs. */
export const starlightPluginLlmsTxt = () =>
starlightLlmsTxt({
// Use raw Markdown content directly instead of rendering entries to avoid
// compatibility issues with the xmdx compiler.
rawContent: true,
// Basic information about the docs and Astro to display in the main `llms.txt` entry file.
projectName: 'Astro',
description: 'Astro is an all-in-one web framework for building websites. ',
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@
"@astrojs/starlight": "^0.38.0",
"@expressive-code/plugin-collapsible-sections": "^0.41.6",
"@lunariajs/core": "https://pkg.pr.new/lunariajs/lunaria/@lunariajs/core@722c34c",
"astro-xmdx": "0.0.10-next.9",
"canvas-confetti": "^1.6.0",
"jsdoc-api": "^9.3.5",
"rehype-slug": "^6.0.0",
"remark-smartypants": "^3.0.2",
"sharp": "^0.34.3",
"starlight-llms-txt": "^0.6.0"
"starlight-llms-txt": "^0.6.0",
"xmdx": "0.0.9-next.3"
},
"packageManager": "pnpm@10.27.0",
"pnpm": {
Expand Down
Loading
Loading