This Eleventy plugin will automatically embed common media formats in your pages, requiring only a URL in your markdown files.
It currently supports Instagram, SoundCloud, Spotify, TikTok, Twitch, Twitter, Vimeo, and YouTube, with more planned.
- ⚡️ Installation
- 🛠 Usage
- 🌈 Supported services
- ⚙️ Settings
⚠️ Notes and caveats
In your Eleventy project, install the plugin through npm:
$ npm i eleventy-plugin-embed-everything
Then add it to your Eleventy config file:
const embedEverything = require("eleventy-plugin-embed-everything");
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(embedEverything);
};
To embed a YouTube video into any Markdown page, paste its URL into a new line. The URL should be the only thing on that line.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, elit vel condimentum porta, purus.
https://www.youtube.com/watch?v=dQw4w9WgXcQ
Maecenas non velit nibh. Aenean eu justo et odio commodo ornare. In scelerisque sapien at.
The same principle applies to the other supported services.
Currently, the plugin supports the following embed services (listed alphabetically):
Service | Handle | Active by default? (How to activate) |
---|---|---|
Bluesky | bluesky |
❌ No |
instagram |
✅ Yes | |
Mastodon | mastodon |
❌ No |
OpenStreetMap | openstreetmap |
✅ Yes |
SoundCloud | soundcloud |
❌ No |
Spotify | spotify |
✅ Yes |
TED | ted |
✅ Yes |
TikTok | tiktok |
✅ Yes |
Twitch | twitch |
✅ Yes |
twitter |
✅ Yes | |
Vimeo | vimeo |
✅ Yes |
YouTube | youtube |
✅ Yes |
[!NOTE] Why are some plugins not active by default? Some services require API calls to fetch the relevant embed data. Because these network calls can affect build times, you'll have to opt-in to using them.
Got a suggestion? File an issue!
The plugin supports a number of frequently used services by default, and they have default settings of their own.
You can configure which services you want active by passing an options object to the addPlugin
function:
Example: configure the plugin to embed all default services plus SoundCloud
eleventyConfig.addPlugin(embedEverything, {
add: ['soundcloud']
});
Example: configure the plugin to embed only Vimeo and Instagram:
eleventyConfig.addPlugin(embedEverything, {
use: ['vimeo', 'instagram']
});
Each service comes with some useful defaults, but you can also configure each one individually. Override each plugin’s defaults by passing an options object that includes its fully-lowercase name as the key:
// configure YouTube videos to prohibit fullscreen
eleventyConfig.addPlugin(embedEverything, {
youtube: {
options: {
allowFullscreen: false
}
}
});
Substitute the plugin Handle (vimeo
, instagram
, and so on) in place of youtube
. Consult the individual plugin packages for their relevant defaults and options.
- This plugin does very little on its own. Instead, it aggregates other embed plugins in a single place.
- Each service is itself a standalone Eleventy plugin, each of which you can install individually.
- If there’s a specific service you’d want added, please open an issue.
- We aim to match 11ty's supported Node.js versions. It may work on older versions but this isn't tested or guaranteed.
For more about each supported service, consult this table of relevant links.
Service | Package | Repository | Options |
---|---|---|---|
Bluesky | npm | GitHub | Options |
npm | GitHub | Options | |
Mastodon | npm | GitHub | Options |
OpenStreetMap | npm | GitHub | Options |
SoundCloud | npm | GitHub | Options |
Spotify | npm | GitHub | Options |
TED | npm | GitHub | Options |
TikTok | npm | GitHub | Options |
Twitch | npm | GitHub | Options |
npm | GitHub | Options | |
Vimeo | npm | GitHub | Options |
YouTube | npm | GitHub | Options |