This is a Twitter Emoji (Twemoji) plugin for Jekyll.
It is based heavily on the work of:
- @ellekasai's Twemoji Awesome (demo / repo);
- @kamalasaurus who provides the Sass map from Emoji to Unicode, over on Twemoji Possum;
- @23maverick23 for the Jekyll source.
- Download
twemoji-awesome.rb
and place it in the_plugins
directory (option #1 in the Jekyll tutorial on installing plugins); - Download either the CSS or the SCSS (Sass) file (the Sass file is smaller!)
- Place the file in your CSS directory (Jekyll will compile the file for you, at build time, in case you pick Sass);
- Link the CSS file in your HTML. For example:
<link rel="stylesheet" href="{{ "/assets/twemoji-awesome.css" | prepend: site.baseurl }}">
- That's it!
You can insert a Twemoji by inserting the following expression to your post:
{% twa heart %}
Where heart
may be replaced by another emoji besides "heart". Check the Emoji Cheat Sheet for valid emoji names. Note that underscores _
must be replaced with hyphens -
. So, for 😛 (:stuck_out_tongue:
), you'd use:
{% twa stuck-out-tongue %}
You can also define a preset size by using lg
, 2x
, 3x
, 4x
or 5x
.
For example:
{% twa pizza 5x %}
Would render a giant pizza!
Works under the 3.0.0 dev version recently released with "gem 'jekyll'" in the gemfile.
Likely works under 2.4.0 as well. Can't say for any other version. I never got 2.5.3 to work right.