From 3b60237cb152aa19526902d30bd02feb39a71f24 Mon Sep 17 00:00:00 2001 From: Shinnosuke Kondo Date: Mon, 13 Jul 2015 18:34:40 -0500 Subject: [PATCH] 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. --- lib/jekyll/cleaner.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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