Skip to content

Instantly share code, notes, and snippets.

@korinVR
Created November 19, 2013 08:39
Show Gist options
  • Save korinVR/7542202 to your computer and use it in GitHub Desktop.
Save korinVR/7542202 to your computer and use it in GitHub Desktop.
Jekyll plugin: pretty URL (remove last index.html)
# 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