Created
October 7, 2016 11:35
-
-
Save lewisnyman/6af3b688b0b0bcb7560dcd748e8831a0 to your computer and use it in GitHub Desktop.
Prevent widows in Jekyll on Github pages
This file contains 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
<!-- { Prevent widows without using a liquid filter } --> | |
{% assign split_title = page.title | split: ' ' %} | |
{% capture title %} | |
{% for word in split_title %}{% if forloop.last == true %} {{ word | strip }}{% else %} {{ word }}{% endif %}{% endfor %} | |
{% endcapture %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment