Aller au contenu

Ce module d’extension active la prise en charge de MD dans StudioCMS.

  1. Installez le paquet à l’aide de la commande suivante :

    Fenêtre de terminal
    npm run studiocms add @studiocms/md
  2. Votre configuration StudioCMS devrait maintenant inclure @studiocms/md :

    studiocms.config.mjs
    import { defineStudioCMSConfig } from 'studiocms/config';
    import md from '@studiocms/md';
    export default defineStudioCMSConfig({
    plugins: [
    md(),
    ],
    });
type StudioCMSMarkdown = {
flavor: "studiocms";
autoLinkHeadings: boolean;
callouts: false | "github" | "obsidian" | "vitepress";
discordSubtext: boolean;
sanitize: {
allowAttributes: Record<string, string[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, string[]>;
dropElements: string[];
};
};
type AstroMarkdown = {
flavor: "astro";
sanitize: {
allowAttributes: Record<string, string[]>;
allowComments: boolean;
allowComponents: boolean;
allowCustomElements: boolean;
allowElements: string[];
blockElements: string[];
dropAttributes: Record<string, string[]>;
dropElements: string[];
};
};