@studiocms/mdx
Introduction
Section titled “Introduction”This plugin enables MDX Support within StudioCMS.
This plugin requires the @studiocms/md plugin.
Installation
Section titled “Installation”-
Install the package using the following command:
Terminal window npm run studiocms add @studiocms/mdxTerminal window pnpm run studiocms add @studiocms/mdxTerminal window yarn run studiocms add @studiocms/mdx -
Your StudioCMS config should now include
@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.
],});