Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use relative path for path Liquid variable in Documents #2908

Merged
merged 2 commits into from Dec 29, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/jekyll/document.rb
Expand Up @@ -232,8 +232,8 @@ def to_liquid
Utils.deep_merge_hashes data, {
"output" => output,
"content" => content,
"path" => path,
"relative_path" => relative_path,
"path" => relative_path,
"url" => url,
"collection" => collection.label
}
Expand Down
4 changes: 4 additions & 0 deletions test/test_document.rb
Expand Up @@ -44,6 +44,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
Expand Down