Merge pull request #3391 from jekyll/enspeeden-include

This commit is contained in:
Parker Moore 2015-01-31 15:41:34 -08:00
commit 3318c38eec
2 changed files with 6 additions and 6 deletions

View File

@ -101,7 +101,7 @@ eos
end end
def tag_includes_dir def tag_includes_dir
'_includes' '_includes'.freeze
end end
def render(context) def render(context)
@ -123,7 +123,7 @@ eos
end end
begin begin
partial = Liquid::Template.parse(source(path, context)) partial = Liquid::Template.parse(read_file(path, context))
context.stack do context.stack do
context['include'] = parse_params(context) if @params context['include'] = parse_params(context) if @params
@ -135,7 +135,7 @@ eos
end end
def resolved_includes_dir(context) def resolved_includes_dir(context)
File.join(File.realpath(context.registers[:site].source), @includes_dir) context.registers[:site].in_source_dir(@includes_dir)
end end
def validate_path(path, dir, safe) def validate_path(path, dir, safe)
@ -155,14 +155,14 @@ eos
end end
# This method allows to modify the file content by inheriting from the class. # This method allows to modify the file content by inheriting from the class.
def source(file, context) def read_file(file, context)
File.read(file, file_read_opts(context)) File.read(file, file_read_opts(context))
end end
end end
class IncludeRelativeTag < IncludeTag class IncludeRelativeTag < IncludeTag
def tag_includes_dir def tag_includes_dir
'.' '.'.freeze
end end
def page_path(context) def page_path(context)

View File

@ -5,7 +5,7 @@ set -e
export BENCHMARK=true export BENCHMARK=true
command -v stackprof > /dev/null || script/bootstrap command -v stackprof > /dev/null || script/bootstrap
TEST_SCRIPT="Jekyll::Commands::Build.process({'source' => 'site'})" TEST_SCRIPT="Jekyll::Commands::Build.process({'source' => 'site', 'full_rebuild' => true})"
PROF_OUTPUT_FILE=tmp/stackprof-$(date +%Y%m%d%H%M).dump PROF_OUTPUT_FILE=tmp/stackprof-$(date +%Y%m%d%H%M).dump
test -f "$PROF_OUTPUT_FILE" || { test -f "$PROF_OUTPUT_FILE" || {