Created
June 11, 2015 08:27
-
-
Save icebeat/b3549030a76c0133cb85 to your computer and use it in GitHub Desktop.
Jekyll plugin - No more widows in your headlines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
module Widow | |
def widow(text) | |
text.gsub!(/ ([^ ]*)$/, ' \1') | |
end | |
end | |
end | |
# Use: {{ page.title | widow }} | |
Liquid::Template.register_filter(Jekyll::Widow) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment