Merge pull request #2908 from alfredxing/document-path

This commit is contained in:
Parker Moore 2014-12-29 00:26:35 -05:00
commit e39dfa3f0b
2 changed files with 5 additions and 1 deletions

View File

@ -240,8 +240,8 @@ module Jekyll
Utils.deep_merge_hashes data, { Utils.deep_merge_hashes data, {
"output" => output, "output" => output,
"content" => content, "content" => content,
"path" => path,
"relative_path" => relative_path, "relative_path" => relative_path,
"path" => relative_path,
"url" => url, "url" => url,
"collection" => collection.label "collection" => collection.label
} }

View File

@ -48,6 +48,10 @@ class TestDocument < Test::Unit::TestCase
assert_equal @document.to_liquid['collection'], "methods" assert_equal @document.to_liquid['collection'], "methods"
end end
should "output its relative path as path in Liquid" do
assert_equal @document.to_liquid['path'], "_methods/configuration.md"
end
end end
context "a document as part of a collection with frontmatter defaults" do context "a document as part of a collection with frontmatter defaults" do