diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 5b1b79ab..31317a46 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -240,8 +240,8 @@ module Jekyll Utils.deep_merge_hashes data, { "output" => output, "content" => content, - "path" => path, "relative_path" => relative_path, + "path" => relative_path, "url" => url, "collection" => collection.label } diff --git a/test/test_document.rb b/test/test_document.rb index 57c14c22..a4543148 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -48,6 +48,10 @@ class TestDocument < Test::Unit::TestCase assert_equal @document.to_liquid['collection'], "methods" end + should "output its relative path as path in Liquid" do + assert_equal @document.to_liquid['path'], "_methods/configuration.md" + end + end context "a document as part of a collection with frontmatter defaults" do