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.
This commit is contained in:
Jeremy Lecour 2010-09-09 09:40:47 +02:00
parent 16c19ecd19
commit e9cf7b4636
1 changed files with 8 additions and 2 deletions

View File

@ -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