Fix keep_files to be used as paths relative to the destination.

They were used as keywords to match files containing them in the paths.
This commit is contained in:
Shinnosuke Kondo 2015-07-13 18:34:40 -05:00
parent e0b8539670
commit 3b60237cb1
1 changed files with 3 additions and 2 deletions

View File

@ -94,11 +94,12 @@ module Jekyll
# Private: Creates a regular expression from the config's keep_files array
#
# Examples
# ['.git','.svn'] creates the following regex: /\/(\.git|\/.svn)/
# ['.git','.svn'] with site.dest "/myblog/_site" creates
# the following regex: /\/myblog\/_site\/(\.git|\/.svn)/
#
# Returns the regular expression
def keep_file_regex
Regexp.union(site.keep_files)
/#{Regexp.quote(site.dest)}\/(#{Regexp.union(site.keep_files).source})/
end
end
end