From e9cf7b46368ede7dc67a5a7318323d6a73728b5b Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Thu, 9 Sep 2010 09:40:47 +0200 Subject: [PATCH] Treat dotfiles as files without extension If the file starts with a dot, the whole filename is considered the basename and there is not extension. --- lib/jekyll/page.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index 3cdce5df..16053b77 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -70,8 +70,14 @@ module Jekyll # # Returns nothing def process(name) - self.ext = File.extname(name) - self.basename = name.split('.')[0..-2].first + # Is it a dotfile ? + if name[/^\./] + self.ext = '' + self.basename = name + else + self.ext = File.extname(name) + self.basename = name.split('.')[0..-2].first + end end # Add any necessary layouts to this post