diff --git a/lib/jekyll/tags/include.rb b/lib/jekyll/tags/include.rb index db19ed8a..aa608bc0 100644 --- a/lib/jekyll/tags/include.rb +++ b/lib/jekyll/tags/include.rb @@ -119,10 +119,14 @@ eos if safe && !realpath_prefixed_with?(path, dir) raise IOError.new "The included file '#{path}' should exist and should not be a symlink" elsif !File.exist?(path) - raise IOError.new "Included file '#{path}' not found" + raise IOError.new "Included file '#{path_relative_to_source(dir, path)}' not found" end end + def path_relative_to_source(dir, path) + File.join(INCLUDES_DIR, path.sub(Regexp.new("^#{dir}"), "")) + end + def realpath_prefixed_with?(path, dir) File.exist?(path) && File.realpath(path).start_with?(dir) end