astro-embeds-integration
v1.0.0-beta.1
Published
Astro integration to automatically convert URLs in Markdown files to embeds
Downloads
4
Readme
astro-embeds-integration
This is an experimental Astro integration that allows you to auto-convert URLs in MDX files to a corresponding embed component.
Install
pnpm i astro-embeds-integration
Usage
To enable the integration, add it to the integrations
array in your astro.config.mjs
file:
import { defineConfig } from 'astro/config'
import mdx from '@astrojs/mdx'
import embeds from 'astro-embeds-integration'
export default defineConfig({
integrations: [
embeds(),
mdx()
],
})
With the integration enabled, any isolated URL in an MDX file that matches one of the astro-embeds
component types will be converted to the appropriate component.
For example, MDX like this will render an optimized YouTube player component in place of the URL.
I saw this cool video the other day:
https://youtu.be/J0XV9W6TxYk