A Liquid figure tag for Jekyll sites
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README.md Google Analytics events Mar 29, 2014
Rakefile Bundler framework Mar 19, 2014
jekyll_figure.gemspec Don't require a specific version of bundler Mar 20, 2014


Jekyll Figure

Adds a Liquid figure tag to a Jekyll site

Lincoln A. Mullen | lincoln@lincolnmullen.com | http://lincolnmullen.com


Add this line to your Jekyll site's Gemfile:

gem 'jekyll_figure'

And then execute:


In the Jekyll site's _config.yml file, add this line:

gems: [jekyll_figure]

If you have a directory where you keep your figures, add these lines to _config.yml:

  dir: /figures

If you would like the figures to be enumerated (e.g., "Figure 1," "Figure 2") then add this value to _config.yml:

  enumerate: true

If you would like to add Google Analytics event tracking to the figure links, then add this value to _config.yml (you must have Google Analytics on your site, obviously):

  analytics: true


To add a figure, use the figure tag in this form:

{% figure filename svg,png,pdf 'Your caption here' %}

The first value is the filename, which should be shared across every format of the figure. The second value is a comma-separated list of extensions for the filename. The third value is a quoted caption. The tag will produce an img tag for the first file format in the list of extensions. It will include a caption with links to all the figure formats. If the figures directory is set in _config.yml, then the image and the links will point there.

You can see an example here.


MIT License http://lmullen.mit-license.org/