From eb5be62cba5b6ab3eadcbf154a2958fd59ea3f14 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 28 Jan 2016 17:19:06 -0800 Subject: [PATCH] Upgrade 2-3 docs, include note about getting one single collection Yay, @pathawks! https://github.com/jekyll/jekyll/issues/4392#issuecomment-174369983 --- site/_docs/history.md | 1 + site/_docs/upgrading/2-to-3.md | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/site/_docs/history.md b/site/_docs/history.md index e93521e7..ab87f569 100644 --- a/site/_docs/history.md +++ b/site/_docs/history.md @@ -10,6 +10,7 @@ permalink: "/docs/history/" ### Minor Enhancements {: #minor-enhancements-v3-1-0} +- Update the Code of Conduct to the latest version ([#4402]({{ site.repository }}/issues/4402)) - Use `Liquid::Drop`s instead of `Hash`es in `#to_liquid` ([#4277]({{ site.repository }}/issues/4277)) - Add 'sample' Liquid filter Equivalent to Array#sample functionality ([#4223]({{ site.repository }}/issues/4223)) - Cache parsed include file to save liquid parsing time. ([#4120]({{ site.repository }}/issues/4120)) diff --git a/site/_docs/upgrading/2-to-3.md b/site/_docs/upgrading/2-to-3.md index e3529f63..d3ff4a38 100644 --- a/site/_docs/upgrading/2-to-3.md +++ b/site/_docs/upgrading/2-to-3.md @@ -32,6 +32,16 @@ A simple conversion must be made in your templates: When iterating over `site.collections`, ensure the above conversions are made. +For `site.collections.myCollection` in Jekyll 2, you now do: + +{% highlight liquid %} +{% raw %} +{% assign myCollection = site.collections | where: "label", "myCollection" | first %} +{% endraw %} +{% endhighlight %} + +This is a bit cumbersome at first, but is easier than a big `for` loop. + ### Dropped dependencies We dropped a number of dependencies the Core Team felt were optional. As such, in 3.0, they must be explicitly installed and included if you use any of the features. They are: