github withastro/astro @astrojs/markdoc@0.4.0

latest releases: astro@4.16.11, astro@5.0.0-beta.7, @astrojs/svelte@6.0.0-beta.2...
16 months ago

Minor Changes

  • #7468 fb7af5511 Thanks @bholmesdev! - Updates the Markdoc config object for rendering Astro components as tags or nodes. Rather than importing components directly, Astro includes a new component() function to specify your component path. This unlocks using Astro components from npm packages and .ts files.

    Migration

    Update all component imports to instead import the new component() function and use it to render your Astro components:

    // markdoc.config.mjs
    import {
      defineMarkdocConfig,
    + component,
    } from '@astrojs/markdoc/config';
    - import Aside from './src/components/Aside.astro';
    
    export default defineMarkdocConfig({
      tags: {
        aside: {
          render: Aside,
    +     render: component('./src/components/Aside.astro'),
        }
      }
    });

Patch Changes

Don't miss a new astro release

NewReleases is sending notifications on new releases.