Take the widows out of your Jekyll.
Create a _plugins
directory in your Jekyll installation if one doesn't
already exist. Throw widont.rb
in there and make sure to restart Jekyll if
it's currently running.
Apply the filter using Liquid's filter syntax, |
, to any string that you
want to process.
<h1>{{ page.title | widont }}</h1>
<div class="entry-content">{{ content | widont }}</div>
Special thanks to Steve Smith for the regular expression he joyfully referred to as "... the best widow-removing regex ever. It's epic."