-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Adds the collection label to a document's data #2436
Conversation
What can you tell me where you people? Do you think this is much more difficult to repair? I translated it in English to express clear! |
@ct0512 Can you please open a new issue describing your problem? Here: https://github.com/jekyll/jekyll/issues/new |
You are?
------------------ Original ------------------ @ct0512 Can you please open a new issue describing your problem? Here: https://github.com/jekyll/jekyll/issues/new ¡ª |
@ct0512 I don't understand your problem. Can you please open a new issue: https://github.com/jekyll/jekyll/issues/new |
@@ -206,7 +206,8 @@ def to_liquid | |||
"content" => content, | |||
"path" => path, | |||
"relative_path" => relative_path, | |||
"url" => url | |||
"url" => url, | |||
"label" => collection.label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just give the person the whole collection? (via collection.to_liquid
)
Sure, but I thought you could derive everything else once you had the label. |
I think I'd rather have |
Either that or |
Yeah, I like this too. I'll make the change On Friday, May 30, 2014, Parker Moore notifications@github.com wrote:
Sent from Gmail Mobile |
@budparr Once you can get this change in (and the associated test), I'll happily merge. |
…into documenttoliquid Conflicts: lib/jekyll/document.rb
…into documenttoliquid
To make it clear the label is of the document's collection
Hi @parkr - I changed the key to collection from label. I still don't understand how to add the test because I would expect to be able to add it to the existing test for other items now in the to_liquid definition but don't understand how they are done. Apologies for the idiocy! |
@@ -206,7 +206,8 @@ def to_liquid | |||
"content" => content, | |||
"path" => path, | |||
"relative_path" => relative_path, | |||
"url" => url | |||
"url" => url, | |||
"collection" => collection.label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra space here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thank you
In terms of adding a test, write another should "output the collection name in the #to_liquid method" do
assert_equal @document.to_liquid['collection'], "methods"
end Make sure it's inside that first |
Thanks, that worked. I was leaving out "['collection']." Really appreciate it - I'm learning! |
Yay! Glad it worked out properly. Happy to help 😄 |
Related to issue #52 in Jekyll/Jekyll-help this PR adds a document's collection label to its available data.
Forgive the noob, please: I tried adding a test test_document.rb in 'should know its data' and it failed, but I think because of the test, not the change. I ran the addition on a local install and it worked there.