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

Expand collections documentation. #3638

Merged
merged 1 commit into from Apr 8, 2015

Conversation

Projects
None yet
3 participants
@adunning
Contributor

adunning commented Apr 4, 2015

The current documentation refers to a location below for a discussion of accessing document variables, but does not provide anything concrete. I have persevered with the albums example, and given something slightly complex in order to show how to access nested attributes (since I found it difficult to find documentation on this).

I also noted a method for setting default variables in collections and fixed a minor typo.

It would also be useful to add an example of how to access nested attributes on the current collection item without using a for loop (I am embarrassed to say that I don't know how to do it myself).

Explain how to access collection variables.
This example also demonstrates the use of nested variables.
{% highlight html %}
{% raw %}
{% for album in site.albums %}

This comment has been minimized.

@parkr

parkr Apr 6, 2015

Member

Does this work as expected?

@parkr

parkr Apr 6, 2015

Member

Does this work as expected?

This comment has been minimized.

@adunning

adunning Apr 6, 2015

Contributor

It does with Jekyll 2.5.3. I'm just not sure about the best way to output only the attributes for the current collection item (i.e. in its individual output); the solutions I have used seem rather unwieldy.

@adunning

adunning Apr 6, 2015

Contributor

It does with Jekyll 2.5.3. I'm just not sure about the best way to output only the attributes for the current collection item (i.e. in its individual output); the solutions I have used seem rather unwieldy.

parkr added a commit that referenced this pull request Apr 8, 2015

@parkr parkr merged commit 9c02353 into jekyll:master Apr 8, 2015

1 check passed

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

parkr added a commit that referenced this pull request Apr 8, 2015

@adunning adunning deleted the adunning:patch-1 branch Apr 13, 2015

@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.