コンテンツにスキップ

mdxファイルのお作法

コードをmdxに直接記述する
import { Code } from '@astrojs/starlight/components'
export const exampleCode = `console.log('This could come from a file or CMS!');`;
export const fileName = 'example.js';
export const highlights = ['file', 'CMS'];
<Code code={exampleCode} lang="js" title={fileName} mark={highlights} />
example.js
console.log('This could come from a file or CMS!');