Coder Social home page Coder Social logo

jekyll-embedly-client's Introduction

A embed.ly client for Jekyll

This is a handy embed.ly client for people that use the static-site generator jekyll.

How to install

  1. Make sure you have the json and domainatrix gems installed.
  2. Download the embedly.rb file and place it in the _plugins/ inside your Jekyll project directory.
  3. Go to the embed.ly site, register an account and get your API key.
  4. Add your site address to the referrer section e.g. 'localhost.com*' or 'www.mywebsite.com*'
  5. Edit your _config.yml as described below.
  6. Make use of the new embedly-Liquid tag somewhere on your site.
    E.g. {% embedly http://soundcloud.com/mightyoaksmusic/rainier %}
  7. 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.

How to set up the _config.yml

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.

Style your embeds

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>

jekyll-embedly-client's People

Contributors

robb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jekyll-embedly-client's Issues

Liquid not correctly seeing new tag

I'm getting an error in my site when using this plugin:

Liquid error: undefined method `[]' for nil:NilClass

Here is my config.yml file parts for the plugin:

embedly:
api_key: my_key_removed_for_security_reasons
vimeo:
width: 500px

Response does not contain HTML

Cool plugin! I tried following your sample with this:

{% embedly  http://soundcloud.com/mightyoaksmusic/rainier, color: 00FFFF %}

But the "resolve" method DID NOT return the HTML key, so I end up with an empty div like this:

<div class="embed link soundcloud"></div>

So, I tried a vimeo embed like this:

{% embedly http://vimeo.com/18150336 %}

And that worked fine by producing this:

<div class="embed video vimeo"><iframe src="http://player.vimeo.com/video/18150336" width="1280" height="720" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>

So....maybe something changed with soundcloud?

Vimeo Player Parameters

I'm trying to use this to embed some vimeo videos in my site with custom player parameters from vimeo. I've added them to to config.yml and added a puts to the file to make sure the URL that's being output is corect according to a forum post I've seen. From what I've seen this should be working, but I'm just getting a regular vimeo video and not a configured one.

Relevant config.yml

embedly:
  api_key: ######################

  vimeo:
    vimeo_color: ff9933
    vimeo_title: 0
    vimeo_byline: 0
    vimeo_portrait: 0

embed.ly url

http://api.embed.ly/1/oembed?key=################&url=https%3A%2F%2Fvimeo.com%2F142537975&vimeo_color=ff9933&vimeo_title=0&vimeo_byline=0&vimeo_portrait=0

I'm kind of lost as to why this isn't working, but I'm new to Ruby and embed.ly so I'm probably missing something. I also tried adding the vimeo parameters to the @@EMBEDLY_PARAMETERS array, but no dice. Any help would be appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.