1.0.0-beta.1 • Published 3 months ago

astro-embeds-integration v1.0.0-beta.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

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