Content Integrations
MDX
Use JSX components in Markdown files
Markdoc
Use Markdoc for content-driven sites
MDX
The MDX integration allows you to use JSX components and import statements in Markdown files.Installation
Configuration
astro.config.mjs
Options
Usage Example
Create an MDX page:src/pages/blog/post.mdx
Using MDX with Components
You can import and use any framework component in MDX:src/content/blog/interactive-post.mdx
Frontmatter in MDX
Access frontmatter in your MDX:Markdoc
Markdoc is a powerful, flexible content authoring format from Stripe.The Markdoc integration is currently experimental.
Installation
Configuration
astro.config.mjs
Custom Tags and Nodes
Create custom Markdoc tags:markdoc.config.mjs
Utility Integrations
Sitemap
Automatically generate a sitemap.xml
Partytown
Relocate scripts to a web worker for better performance
Sitemap
The Sitemap integration automatically generates asitemap.xml file for your site.
Installation
Configuration
astro.config.mjs
Options
Generated Output
The sitemap will be generated at/sitemap-index.xml and includes all static routes:
Partytown
Partytown relocates resource-intensive scripts into a web worker, freeing up the main thread.Installation
Configuration
astro.config.mjs
Options
Usage Example
Add thetype="text/partytown" attribute to scripts you want to run in a web worker:
src/pages/index.astro
Common Use Cases
- Google Analytics / Google Tag Manager
- Facebook Pixel
- Third-party analytics scripts
- Heavy third-party libraries
DB (Database)
Astro DB provides a fully-managed SQL database designed for Astro.Astro DB is available in Astro 4.5 and later.
Installation
Define Your Schema
db/config.ts
Query Your Database
src/pages/blog.astro
Next Steps
UI Frameworks
Add React, Vue, Svelte, and other UI frameworks
SSR Adapters
Deploy with server-side rendering