A Jekyll converter plugin that converts YouTube, and Vimeo, URLs into responsive embed markup.

The media URL

Mark the URL as being one you want to convert by appending ?jekyll_embed to the URL.

For example this markdown link:

[The Magic Is in The Process](https://vimeo.com/72040407?jekyll_embed)

is converted to:

<style>
.embed-container { 
  position: relative; padding-bottom: 56.25%; height: 0;
  overflow: hidden; max-width: 100%; height: auto;
}
.embed-container iframe, .embed-container object, 
.embed-container embed { 
  position: absolute; top: 0; left: 0; width: 100%; 
  height: 100%; 
}
</style>
<div class="embed-container">
  <iframe src="https://player.vimeo.com/video/72040407" 
          frameborder="0" webkitallowfullscreen="" 
          mozallowfullscreen="" allowfullscreen="">
  </iframe>
</div>

Installation

Copy responsive_embed.rb from the repository and place it in the _plugins directory of your Jekyll site.