@studiocms/mdx
Présentation
Section intitulée « Présentation »Ce module d’extension active la prise en charge MDX dans StudioCMS.
Ce module d’extension nécessite le module d’extension @studiocms/md.
Installation
Section intitulée « Installation »-
Installez le paquet à l’aide de la commande suivante :
Fenêtre de terminal npm run studiocms add @studiocms/mdxFenêtre de terminal pnpm run studiocms add @studiocms/mdxFenêtre de terminal yarn run studiocms add @studiocms/mdx -
Votre configuration StudioCMS devrait désormais inclure
@studiocms/mdx:studiocms.config.mjs import {defineStudioCMSConfig } from 'studiocms/config';function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptionsA utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is
studiocms.config.mjs. And it should be adjacent to the Astro project'sastro.config.mjsfile.StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.
Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.
importmdx from '@studiocms/mdx';function mdx(options?: MDXPluginOptions): StudioCMSPluginCreates and configures the StudioCMS MDX plugin.
export defaultdefineStudioCMSConfig({function defineStudioCMSConfig(config: StudioCMSOptions): StudioCMSOptionsA utility function to define the StudioCMS config object. This function is used to define the optional StudioCMS config object in the Astro project root. The expected file name is
studiocms.config.mjs. And it should be adjacent to the Astro project'sastro.config.mjsfile.StudioCMS will attempt to import this file and use the default export as the StudioCMS config object automatically if it exists.
Using this function is optional, but it can be useful for IDEs to provide better intellisense and type checking.
plugins: [StudioCMSOptions.plugins?: StudioCMSPlugin[]Add Plugins to the StudioCMS
mdx(),function mdx(options?: MDXPluginOptions): StudioCMSPluginCreates and configures the StudioCMS MDX plugin.
],});