Extended Markdown and MDX Features#
This post demonstrates how the extended Markdown and MDX features from our current setup behave inside a real blog article. All of the examples below are wired through:
remark-directiveremark-directive-sugarrehype-calloutsremark-imgattrremark-mathremark-cdn
Callouts#
Callouts use the VitePress-style syntax and are rendered by rehype-callouts:
Highlights information that readers should take into account, even when skimming.
Optional information to help a reader be more successful.
This is a collapsible callout, initially closed.
Crucial information necessary for readers to succeed.
This is a collapsible callout, initially open.
Critical content demanding immediate attention.
Badges and Styled Links#
The :badge and :link directives come from remark-directive-sugar:
- Status: ACTIVE
- Repository: Astro
Corrected link directive:
- Typed content collections:
remark-directive-sugar
You can also attach custom URLs:
- Documentation: docs.astro.build
- Search: MDN JavaScript
Image Figure Directive and CDN Images#
You can combine :::image-figure with remark-cdn by pointing images to the CDN keys.
The manifest contains an entry for images/0321_good.png, so we can safely reference:

For more control, you can also use the <Figure> MDX component directly:
Both approaches will be rewritten at build time to hashed asset URLs using the manifest.
Inline Math and Display Math#
Math is handled by remark-math and rehype-katex. Inline math:
Inline example: appears within the sentence.
Display math:
Putting It All Together#
The combination of:
- Astro content collections
- MDX with directives and custom components
remark-cdnfor asset rewritingrehype-calloutsfor callouts
creates a powerful but maintainable writing environment.
For a more traditional article combining code, images, tables, and sidenotes, see the earlier sample post.