Embed

Embed external content from popular platforms. URLs are automatically detected and converted to the appropriate embed format. Supports YouTube, Vimeo, Twitter/X, CodePen, and Spotify.

Basic usage

Pass a URL and optional title to embed content from a supported provider.

{% embed url="https://www.youtube.com/watch?v=dQw4w9WgXcQ" title="Example video" /%}

With fallback content

Children become fallback content displayed when the embed cannot load.

{% embed url="https://example.com/video" %}
Video could not be loaded. [Watch on the original site](https://example.com/video).
{% /embed %}

Video could not be loaded. Watch on the original site.

Supported providers

ProviderExample URL
YouTubehttps://www.youtube.com/watch?v=... or https://youtu.be/...
Vimeohttps://vimeo.com/...
Twitter/Xhttps://twitter.com/.../status/...
CodePenhttps://codepen.io/.../pen/...
Spotifyhttps://open.spotify.com/...
GenericAny other URL (rendered as iframe)

Attributes

AttributeTypeDefaultDescription
urlstringrequiredURL to embed
typestringContent type (auto-detected from URL if omitted)
aspectstring16:9Aspect ratio: 16:9, 4:3, 1:1, or auto
titlestringAccessible title for the iframe