diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb index 70bd2f79..2a00a737 100644 --- a/lib/jekyll/cleaner.rb +++ b/lib/jekyll/cleaner.rb @@ -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