diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb index a8b269f4..4c93411d 100644 --- a/lib/jekyll/cleaner.rb +++ b/lib/jekyll/cleaner.rb @@ -36,7 +36,7 @@ module Jekyll # Returns a Set with the file paths def existing_files files = Set.new - Dir.glob(site.in_dest_dir("**", "*"), File::FNM_DOTMATCH) do |file| + Dir.glob(site.reader.in_dest_dir("**", "*"), File::FNM_DOTMATCH) do |file| files << file unless file =~ /\/\.{1,2}$/ || file =~ keep_file_regex || keep_dirs.include?(file) end files @@ -83,7 +83,7 @@ module Jekyll # # Returns a Set with the directory paths def keep_dirs - site.keep_files.map { |file| parent_dirs(site.in_dest_dir(file)) }.flatten.to_set + site.keep_files.map { |file| parent_dirs(site.reader.in_dest_dir(file)) }.flatten.to_set end # Private: Creates a regular expression from the config's keep_files array diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index cd407dfa..5419647c 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -162,8 +162,8 @@ module Jekyll # # Returns the full path to the output file of this document. def destination(base_directory) - dest = site.in_dest_dir(base_directory) - path = site.in_dest_dir(dest, URL.unescape_path(url)) + dest = site.reader.in_dest_dir(base_directory) + path = site.reader.in_dest_dir(dest, URL.unescape_path(url)) path = File.join(path, "index.html") if url.end_with?("/") path << output_ext unless path.end_with?(output_ext) path diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index ca824245..75ca190c 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -140,7 +140,7 @@ module Jekyll # # Returns the destination file path String. def destination(dest) - path = site.in_dest_dir(dest, URL.unescape_path(url)) + path = site.reader.in_dest_dir(dest, URL.unescape_path(url)) path = File.join(path, "index.html") if url.end_with?("/") path << output_ext unless path.end_with?(output_ext) path diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 5d48d180..c80a35e4 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -278,7 +278,7 @@ module Jekyll # Returns destination file path String. def destination(dest) # The url needs to be unescaped in order to preserve the correct filename - path = site.in_dest_dir(dest, URL.unescape_path(url)) + path = site.reader.in_dest_dir(dest, URL.unescape_path(url)) path = File.join(path, "index.html") if self.url.end_with?("/") path << output_ext unless path.end_with?(output_ext) path diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index d8a1d7bf..9b71db3b 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -99,16 +99,6 @@ module Jekyll end end - # Public: Prefix a given path with the destination directory. - # - # paths - (optional) path elements to a file or directory within the - # destination directory - # - # Returns a path which is prefixed with the destination directory. - def in_dest_dir(*paths) - reader.in_dest_dir(*paths) - end - # The list of collections and their corresponding Jekyll::Collection instances. # If config['collections'] is set, a new instance is created for each item in the collection. # If config['collections'] is not set, a new hash is returned. diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index b83f4fae..cb1b3079 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -35,7 +35,7 @@ module Jekyll # # Returns destination file path. def destination(dest) - @site.in_dest_dir(*[dest, destination_rel_dir, @name].compact) + @site.reader.in_dest_dir(*[dest, destination_rel_dir, @name].compact) end def destination_rel_dir