1.18.2 • Published 2 months ago

eleventy-plugin-embed-everything v1.18.2

Weekly downloads
264
License
MIT
Repository
github
Last release
2 months ago

eleventy-plugin-embed-everything

NPM Version Build test status codecov\ MIT License Contributor Covenant

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

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);
};

🛠 Usage

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.

Markdown file example:

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.

Result:

Rick Astley performing “Never gonna give you up”

🌈 Supported services

Currently, the plugin supports the following embed services (listed alphabetically):

On by default:

  • Instagram
  • Spotify
  • TikTok
  • Twitch
  • Twitter
  • Vimeo
  • YouTube

Off by default (How to activate)

  • SoundCloud

More are planned!

⚙️ Settings

The plugin supports a number of frequently used services by default, and they have default settings of their own.

Configure which embed services are active

You can configure which services you want active by passing an options object to the addPlugin function:

Example (✨ New in 1.11.0): 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']
});

Configure embed services individually

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 vimeo, instagram, and so on in place of youtube. Consult the individual plugin packages for their relevant defaults and options.

⚠️ Notes and caveats

  • 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.
  • This plugin is in its early stages, with only a few supported embed patterns right now. If there’s a specific service you want added, please open an issue.
  • This plugin is not tested against Node.js 8 (since ava doesn’t support it). I believe the plugin still works, but Node.js < 10 compatibility is best-effort only at this point, and will be explicitly dropped in future.

Aggregated plugins

For more about each supported service, consult this table of relevant links.

ServicePackageRepositoryOptions
InstagramnpmGitHubOptions
SoundCloudnpmGitHubOptions
SpotifynpmGitHubOptions
TikToknpmGitHubOptions
TwitchnpmGitHubOptions
TwitternpmGitHubOptions
VimeonpmGitHubOptions
YouTubenpmGitHubOptions
1.18.2

3 months ago

1.18.1

4 months ago

1.18.0

4 months ago

1.17.0

7 months ago

1.16.0

12 months ago

1.15.1

1 year ago

1.16.0-next.0

1 year ago

1.15.2-next.0

1 year ago

1.15.0

1 year ago

1.15.0-next.1

1 year ago

1.15.0-next.0

1 year ago

1.14.1

2 years ago

1.14.0

2 years ago

1.13.3

3 years ago

1.13.2

3 years ago

1.13.1

3 years ago

1.13.0

3 years ago

1.12.0

3 years ago

1.11.0

3 years ago

1.10.0

3 years ago

1.9.4

3 years ago

1.9.3

4 years ago

1.9.2

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago