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

Merged
merged 10 commits into from Jun 4, 2014

Conversation

Projects
None yet
4 participants
@budparr
Contributor

budparr commented May 23, 2014

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.

@ct0512

This comment has been minimized.

Show comment
Hide comment
@ct0512

ct0512 May 23, 2014

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 commented May 23, 2014

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!

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr May 23, 2014

Member

@ct0512 Can you please open a new issue describing your problem? Here: https://github.com/jekyll/jekyll/issues/new

Member

parkr commented May 23, 2014

@ct0512 Can you please open a new issue describing your problem? Here: https://github.com/jekyll/jekyll/issues/new

@ct0512

This comment has been minimized.

Show comment
Hide comment
@ct0512

ct0512 May 23, 2014

You are?

 Want to know what?

------------------ Original ------------------
From: "notifications";notifications@github.com;
Date: Fri, May 23, 2014 01:24 PM
To: "jekyll/jekyll"jekyll@noreply.github.com;
Cc: "°®ÎÒÄã»áÍ´"laochenmxj@foxmail.com;
Subject: Re: [jekyll] Adds the collection label to a document's data (#2436)

@ct0512 Can you please open a new issue describing your problem? Here: https://github.com/jekyll/jekyll/issues/new

¡ª
Reply to this email directly or view it on GitHub.

ct0512 commented May 23, 2014

You are?

 Want to know what?

------------------ Original ------------------
From: "notifications";notifications@github.com;
Date: Fri, May 23, 2014 01:24 PM
To: "jekyll/jekyll"jekyll@noreply.github.com;
Cc: "°®ÎÒÄã»áÍ´"laochenmxj@foxmail.com;
Subject: Re: [jekyll] Adds the collection label to a document's data (#2436)

@ct0512 Can you please open a new issue describing your problem? Here: https://github.com/jekyll/jekyll/issues/new

¡ª
Reply to this email directly or view it on GitHub.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr May 23, 2014

Member

@ct0512 I don't understand your problem. Can you please open a new issue: https://github.com/jekyll/jekyll/issues/new

Member

parkr commented May 23, 2014

@ct0512 I don't understand your problem. Can you please open a new issue: https://github.com/jekyll/jekyll/issues/new

@budparr budparr referenced this pull request May 30, 2014

Closed

Release Jekyll 2.1.0 #2465

5 of 7 tasks complete
@parkr

View changes

Show outdated Hide outdated lib/jekyll/document.rb
@budparr

This comment has been minimized.

Show comment
Hide comment
@budparr

budparr May 30, 2014

Contributor

Sure, but I thought you could derive everything else once you had the label.

Contributor

budparr commented May 30, 2014

Sure, but I thought you could derive everything else once you had the label.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr May 30, 2014

Member

I think I'd rather have document.collection.label, just so we know it's the collection label. document.label is a bit confusing to me.

Member

parkr commented May 30, 2014

I think I'd rather have document.collection.label, just so we know it's the collection label. document.label is a bit confusing to me.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr May 30, 2014

Member

Either that or document.collection is the collection label.

Member

parkr commented May 30, 2014

Either that or document.collection is the collection label.

@budparr

This comment has been minimized.

Show comment
Hide comment
@budparr

budparr May 30, 2014

Contributor

Yeah, I like this too. I'll make the change

On Friday, May 30, 2014, Parker Moore notifications@github.com wrote:

Either that or document.collection is the collection label.

Reply to this email directly or view it on GitHub
#2436 (comment).

Sent from Gmail Mobile

Contributor

budparr commented May 30, 2014

Yeah, I like this too. I'll make the change

On Friday, May 30, 2014, Parker Moore notifications@github.com wrote:

Either that or document.collection is the collection label.

Reply to this email directly or view it on GitHub
#2436 (comment).

Sent from Gmail Mobile

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Jun 1, 2014

Member

@budparr Once you can get this change in (and the associated test), I'll happily merge.

Member

parkr commented Jun 1, 2014

@budparr Once you can get this change in (and the associated test), I'll happily merge.

budparr added some commits May 23, 2014

Merge branch 'documenttoliquid' of https://github.com/budparr/jekyll
…into documenttoliquid

Conflicts:
lib/jekyll/document.rb
change label to collection
To make it clear the label is of the document's collection
@budparr

This comment has been minimized.

Show comment
Hide comment
@budparr

budparr Jun 2, 2014

Contributor

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!

Contributor

budparr commented Jun 2, 2014

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!

@parkr

View changes

Show outdated Hide outdated lib/jekyll/document.rb
@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Jun 2, 2014

Member

In terms of adding a test, write another should block in https://github.com/jekyll/jekyll/blob/7a9bc641ee30b5e926f22e39ddd35f94a96562dc/test/test_document.rb:

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 context block and you should be good to go!

Member

parkr commented Jun 2, 2014

In terms of adding a test, write another should block in https://github.com/jekyll/jekyll/blob/7a9bc641ee30b5e926f22e39ddd35f94a96562dc/test/test_document.rb:

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 context block and you should be good to go!

@budparr

This comment has been minimized.

Show comment
Hide comment
@budparr

budparr Jun 2, 2014

Contributor

Thanks, that worked. I was leaving out "['collection']." Really appreciate it - I'm learning!

Contributor

budparr commented Jun 2, 2014

Thanks, that worked. I was leaving out "['collection']." Really appreciate it - I'm learning!

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Jun 2, 2014

Member

Thanks, that worked. I was leaving out "['collection']." Really appreciate it - I'm learning!

Yay! Glad it worked out properly. Happy to help 😄

Member

parkr commented Jun 2, 2014

Thanks, that worked. I was leaving out "['collection']." Really appreciate it - I'm learning!

Yay! Glad it worked out properly. Happy to help 😄

@parkr parkr merged commit 4e26874 into jekyll:master Jun 4, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@budparr budparr deleted the budparr:documenttoliquid branch Jun 4, 2014

parkr added a commit that referenced this pull request Jun 4, 2014

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.