Skip to content

@studiocms/[email protected]

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 14 Sep 10:49
· 40 commits to main since this release
7c35e9f

Patch Changes

  • 12bed03: Update dependencies

  • 12bed03: [Code Scanning Fix] Polynomial regular expression used on uncontrolled data

    • Replace function used for leading and trailing slashes (Non-Breaking)
  • 1383e80: [Update] Add MDX Renderer:

    • Add mdxConfig schema and renderer option for new MDX renderer
    • Add renderer to StudioCMSRenderer
  • 12bed03: [Refactor]: Update virtual module generation

    • Move virtual:studiocms/astromdremarkConfig and rename to studiocms:renderer/astroMarkdownConfig from the @studiocms/core to @studiocms/renderers
    • New virtual module for the rendererConfig studiocms:renderer/config
  • 12bed03: [Refactor]: Update main config schema for renderers.

    • Removed contentRenderer and markedConfig from the main options
    • Added config for MarkDoc
    • Created new rendererConfig section:
    // astro.config.mjs
    // https://astro.build/config
    export default defineConfig({
      // ...Rest of Astro Config
      integrations: [
        studiocms({
          // ...Rest of StudioCMS Config
          // (This is the same if you use the 'studiocms.config.mjs' file)
          rendererConfig: {
            renderer: "marked", // Can also be 'astro', or 'markdoc'
            markedConfig: {
              /* MarkedJS Config */
            },
            markdocConfig: {
              /* MarkDoc Config */
            },
          },
        }),
      ],
    });
  • 12bed03: [Migrate/Deprecation]: customRendererPlugin moved to StudioCMSRendererConfig

    • Deprecation of StudioCMSPluginOptions defined CustomRenderers
    • Add new option to define renderers from StudioCMSOptions config:
    // astro.config.mjs
    function simpleHTMLRenderer(content: string) {
      return {
        name: "simple-html-renderer",
        renderer: async (content: string) => {
          return `<p>${content}</p>`;
        },
      };
    }
    
    // https://astro.build/config
    export default defineConfig({
      // ...Rest of Astro Config
      integrations: [
        studiocms({
          // ...Rest of StudioCMS Config
          // (This is the same if you use the 'studiocms.config.mjs' file)
          rendererConfig: {
            renderer: simpleHTMLRenderer,
          },
        }),
      ],
    });