0.0
No commit activity in last 3 years
No release in over 3 years
Liquid tag for displaying HTML previews (embeds) for links.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 3.0
>= 0

Runtime

~> 1.8
 Project Readme

Jekyll::Onebox

Gem Version

Liquid tag for displaying HTML previews (embeds) for links to popular websites: {% onebox %}.

Installation

Add this line to your application's Gemfile:

$ gem 'jekyll-onebox'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jekyll-onebox

Then add the following to your site's _config.yml:

plugins:
  - jekyll-onebox

💡 If you are using a Jekyll version less than 3.5.0, use the gems key instead of plugins.

Usage

Use the tag as follows in your Jekyll pages, posts and collections:

{% onebox https://github.com/rriemann/jekyll-onebox/blob/master/README.md %}

This will create a html preview, i.e. an embed, for websites supported by the ruby gem onebox.

The html preview depends on the actual link and may be the oEmbed or Open Graph of a (whitelisted) website with support for those previews. Onebox also comes with many engines to construct a custom preview for supported websites, such as IMDB, Amazon, Wikipedia, Spotify, Soundcloud etc.

Pro-tip: Onebox uses in most cases HTTP GET requests to fetch content from the provided link. With evolving website content or updates of the Onebox gem, the html preview of the same link may also evolve.

Custom Whitelisting

If Onebox does not support a domain out of the box, but implements either oEmbed or Open Graph, than support can be added by simple whitelisting. Please find in the Onebox code a list of all whitelisted domains.

If a domain is not supported and does not implement oEmbed or Open Graph, than a new engine must be added to the Onebox gem.

onebox:
  whitelist:
    - blog.riemann.cc
    - tagesschau.de

TODO

  • add caching of previews to speed-up page builds

Similar Projects

Contributing

  1. Fork it ( https://github.com/rriemann/jekyll-onebox/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request