Created
November 19, 2013 08:39
-
-
Save korinVR/7542202 to your computer and use it in GitHub Desktop.
Jekyll plugin: pretty URL (remove last index.html)
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
# Pretty URL (remove last index.html) | |
# usage: {{ post.url | pretty }} | |
module Jekyll | |
module Pretty | |
def pretty(url) | |
if url[-10..-1] == "index.html" | |
url = url[0..-11] | |
end | |
return url | |
end | |
end | |
end | |
Liquid::Template.register_filter(Jekyll::Pretty) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment