Created
March 7, 2014 22:32
-
-
Save bencates/9421593 to your computer and use it in GitHub Desktop.
Simple Jekyll plugin to convert files into directories with indexes.
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
module PrettyUrls | |
class Generator < Jekyll::Generator | |
def generate(site) | |
site.pages.each do |page| | |
if page.name.split('/').last !~ /^index.\w+$/ | |
page.data['permalink'] ||= page.name.gsub(/\.\w+$/, '/index.html') | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment