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

Adds the collection label to a document's data #2436

Merged
merged 10 commits into from
Jun 4, 2014
3 changes: 2 additions & 1 deletion lib/jekyll/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ def to_liquid
"content" => content,
"path" => path,
"relative_path" => relative_path,
"url" => url
"url" => url,
"label" => collection.label
Copy link
Member

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)

}
else
data
Expand Down
10 changes: 10 additions & 0 deletions site/docs/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,16 @@ In addition to any YAML front-matter provided in the document's corresponding fi
</p>
</td>
</tr>
<tr>
<td>
<p><code>label</code></p>
</td>
<td>
<p>
The name of the document's collection.
</p>
</td>
</tr>
</tbody>
</table>
</div>