#Jekyll Base64 Encoder A Liquid tag for base64 encoding
Note: this plugin requires Colorize:
gem install colorize
Save the Jekyll-base64.rb
file (below this readme) in your plugins_dir
folder.
Usage example: you can rewrite this code
<img src="images/FTF15.jpg" alt="A photo of From The Front Conference" />
into:
<img src="{% base64 images/FTF15.jpg %}" alt="A photo of From The Front Conference" />
The image path can be relative to the page itself or absolute (when it starts with a /
) from your Jekyll's source
folder.
You can even pass a variable as the argument to the Liquid tag, e.g. when the image src
must be interpolated with another variable:
{% capture jpeg %}images/{{ image }}.jpg{% endcapture %}
<img src="{% base64 jpeg %}" alt="..." />
Example Output:
Author: Fabrizio Calderan @fcalderan
Created on : 2015-09-25
Last update : 2015-10-14
License: CC BY-SA 4.0