This is a handy embed.ly client for people that use the static-site generator jekyll.
- Make sure you have the json and domainatrix gems installed.
- Download the
embedly.rb
file and place it in the_plugins/
inside your Jekyll project directory. - Go to the embed.ly site, register an account and get your API key.
- Add your site address to the referrer section e.g. 'localhost.com*' or 'www.mywebsite.com*'
- Edit your
_config.yml
as described below. - Make use of the new
embedly
-Liquid tag somewhere on your site.
E.g.{% embedly http://soundcloud.com/mightyoaksmusic/rainier %}
- Compile your site.
Please not that github-pages does not allow the use of plugins, if you want to make use of this plugin, you have to compile your site yourself.
First, pass in your newly acquired API key like so:
embedly:
api_key: abcdefg123456780cafebabe101cat44
You can further customize your embeds adding host-specific parameters.
embedly:
api_key: abcdefg123456780cafebabe101cat44
soundcloud:
color: 0066FF # SoundCloud specific parameter for colorful players
width: 500px
vimeo:
width: 500px
You can also pass along parameters to individual embeds, e.g.
{% embedly http://soundcloud.com/mightyoaksmusic/rainier, color: 00FFFF %}
# Linebreaks are currently not supported :-/
For a list of supported parameters, please have a look at embed.ly’s documentation as well as the documentation for the oEmbed implementation of the specific hosts.
Provider specific parameters are currently not working properly across the board. Please let me know what works and what doesn't.
Your embed will be wrapped inside a div
-tag that has classes matching the
embeds type, provider as well as the generic embed
.
E.g.
{% embedly http://soundcloud.com/mightyoaksmusic/rainier %}
will result in
<div class="embed rich soundcloud">
...
</div>