#7351a30f2f3de Thanks @bholmesdev! - Fix cloudflare build errors for a bad β./configβ entrypoint and βnode:cryptoβ getting included unexpectedly.
#7341491c2db42 Thanks @bholmesdev! - Improve error message for unsupported Zod transforms from the content config.
#7185339529fc8 Thanks @bholmesdev! - Bring back improved style and script handling across content collection files. This addresses bugs found in a previous release to @astrojs/markdoc.
#7244bef3a75db Thanks @bholmesdev! - Remove the auto-generated $entry variable for Markdoc entries. To access frontmatter as a variable, you can pass entry.data as a prop where you render your content:
---
import { getEntry } from'astro:content';
constentry=awaitgetEntry('docs', 'why-markdoc');
const { Content } =await entry.render();
---
<Contentfrontmatter={entry.data} />
π Patch Changes
#71871efaef6be Thanks @bholmesdev! - Add support for syntax highlighting with Shiki. Apply to your Markdoc config using the extends property:
#720916b836411 Thanks @bholmesdev! - Add a built-in extension for syntax highlighting with Prism. Apply to your Markdoc config using the extends property:
#6850c6d7ebefd Thanks @bholmesdev! - Content collections now support data formats including JSON and YAML. You can also create relationships, or references, between collections to pull information from one collection entry into another. Learn more on our updated Content Collections docs.
#7095fb84622af Thanks @bholmesdev! - Generate heading ids and populate the headings property for all Markdoc files
#693249514e4ce Thanks @bluwy! - Upgrade shiki to v0.14.1. This updates the shiki theme colors and adds the theme name to the pre tag, e.g. <pre class="astro-code github-dark">.
#66537c439868a Thanks @bholmesdev! - Simplify Markdoc configuration with a new markdoc.config.mjs file. This lets you import Astro components directly to render as Markdoc tags and nodes, without the need for the previous components property. This new configuration also unlocks passing variables to your Markdoc from the Content component (see the new docs).
Move any existing Markdoc config from your astro.config to a new markdoc.config.mjs file at the root of your project. This should be applied as a default export, with the optional defineMarkdocConfig() helper for autocomplete in your editor.
This example configures an aside Markdoc tag. Note that components should be imported and applied to the render attribute directly, instead of passing the name as a string:
You should also remove the components prop from your Content components. Since components are imported into your config directly, this is no longer needed.
#6630cfcf2e2ff Thanks @bholmesdev! - Support automatic image optimization for Markdoc images when using experimental.assets. You can follow our Assets guide to enable this feature in your project. Then, start using relative or aliased image sources in your Markdoc files for automatic optimization:
<!--Relative paths-->

<!--Or configured aliases-->

#6588f42f47dc6 Thanks @bholmesdev! - Allow access to content collection entry information (including parsed frontmatter and the entry slug) from your Markdoc using the $entry variable:
#6209fec583909 Thanks @bholmesdev! - Introduce the (experimental) @astrojs/markdoc integration. This unlocks Markdoc inside your Content Collections, bringing support for Astro and UI components in your content. This also improves Astro core internals to make Content Collections extensible to more file types in the future.
You can install this integration using the astro add command: