gitbook-plugin-iframely

1.0.0 • Public • Published

Gitbook plugin iframely

Get any video or iframe card supported by iframely. (Vimeo, YouTube, Facebook, Twitter, Instagram, etc)

If you prefer an option without the need for an API key or depending on creating an account, you can try gitbook-plugin-noembed. It has less supported sites than iframely but still has all the popular ones and more.

Installation

Add "iframely" to your plugins in book.json.

{
  "plugins": ["iframely"]
}

API Key (Required)

You need an API key from iframely (FREE or paid). The free one can get you started and should work for most cases.

Once you have the key, add it to your environment variable or book.json when executing gitbook-cli. If both environment variable and book.json are assigned, it will be prior to use values from environment variable.

> IFRAMELY_APIKEY=YOUR_IFRAMELY_APIKEY gitbook build
# or 
> IFRAMELY_APIKEY=YOUR_IFRAMELY_APIKEY gitbook serve
{
  "pluginsConfig": {
    "iframely": {
      "apiKey": "YOUR_API_KEY"
    }
  }
}

Usage

  • You can use two filters: iframely or video. (At the moment they both do exactly the same)
  • Make sure you wrap your URL around single or double quotes.
{{ 'https://vimeo.com/31942602' | iframely }}
 
or
 
{{ 'https://vimeo.com/31942602' | video }}

Package Sidebar

Install

npm i gitbook-plugin-iframely

Weekly Downloads

2

Version

1.0.0

License

Apache-2.0

Last publish

Collaborators

  • juancgonza