From f623404b89d857b27bfb02d4dba80fe549d2a483 Mon Sep 17 00:00:00 2001 From: Bud Parr Date: Thu, 22 May 2014 21:19:47 -0400 Subject: [PATCH 1/7] add collection.label to Document#to_liquid --- lib/jekyll/document.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 0fb6719f..5dbc47f0 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -206,7 +206,8 @@ module Jekyll "content" => content, "path" => path, "relative_path" => relative_path, - "url" => url + "url" => url, + "label" => collection.label } else data From 2e2aac5988c3eb869b81fc141fb55089fcc4cd02 Mon Sep 17 00:00:00 2001 From: Bud Parr Date: Thu, 22 May 2014 21:30:40 -0400 Subject: [PATCH 2/7] add label to document section of collections page --- site/docs/collections.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/site/docs/collections.md b/site/docs/collections.md index 47ecc462..15e63ad0 100644 --- a/site/docs/collections.md +++ b/site/docs/collections.md @@ -244,6 +244,16 @@ In addition to any YAML front-matter provided in the document's corresponding fi

+ + +

label

+ + +

+ The name of the document's collection. +

+ + From 00ab79b7cf6a91a78d5bbed85e827bb08dddb5e3 Mon Sep 17 00:00:00 2001 From: Bud Parr Date: Thu, 22 May 2014 21:19:47 -0400 Subject: [PATCH 3/7] add collection.label to Document#to_liquid --- lib/jekyll/document.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 0fb6719f..5dbc47f0 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -206,7 +206,8 @@ module Jekyll "content" => content, "path" => path, "relative_path" => relative_path, - "url" => url + "url" => url, + "label" => collection.label } else data From 69aae64133739c7d8d6f3808af11de810c112f21 Mon Sep 17 00:00:00 2001 From: Bud Parr Date: Sun, 1 Jun 2014 22:36:20 -0400 Subject: [PATCH 4/7] Merge branch 'documenttoliquid' of https://github.com/budparr/jekyll into documenttoliquid Conflicts: lib/jekyll/document.rb --- site/docs/collections.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/site/docs/collections.md b/site/docs/collections.md index 47ecc462..15e63ad0 100644 --- a/site/docs/collections.md +++ b/site/docs/collections.md @@ -244,6 +244,16 @@ In addition to any YAML front-matter provided in the document's corresponding fi

+ + +

label

+ + +

+ The name of the document's collection. +

+ + From 90bc9314f1c9cacf5284aa322b3e171e9e158595 Mon Sep 17 00:00:00 2001 From: Bud Parr Date: Mon, 2 Jun 2014 14:32:52 -0400 Subject: [PATCH 5/7] change label to collection To make it clear the label is of the document's collection --- lib/jekyll/document.rb | 2 +- site/docs/collections.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 5dbc47f0..28d19478 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -207,7 +207,7 @@ module Jekyll "path" => path, "relative_path" => relative_path, "url" => url, - "label" => collection.label + "collection" => collection.label } else data diff --git a/site/docs/collections.md b/site/docs/collections.md index 15e63ad0..91460c96 100644 --- a/site/docs/collections.md +++ b/site/docs/collections.md @@ -246,7 +246,7 @@ In addition to any YAML front-matter provided in the document's corresponding fi -

label

+

collection

From 441ac3742cfc7c5618ea77000cf46ac2cfc57259 Mon Sep 17 00:00:00 2001 From: Bud Parr Date: Mon, 2 Jun 2014 15:05:03 -0400 Subject: [PATCH 6/7] remove extra space --- lib/jekyll/document.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 28d19478..248e6d15 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -207,7 +207,7 @@ module Jekyll "path" => path, "relative_path" => relative_path, "url" => url, - "collection" => collection.label + "collection" => collection.label } else data From dc622470c900c34aa1ac897deec8c3eebd2872af Mon Sep 17 00:00:00 2001 From: Bud Parr Date: Mon, 2 Jun 2014 15:12:21 -0400 Subject: [PATCH 7/7] add test for collection name --- test/test_document.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test_document.rb b/test/test_document.rb index 794c2117..672f7d2e 100644 --- a/test/test_document.rb +++ b/test/test_document.rb @@ -40,6 +40,10 @@ class TestDocument < Test::Unit::TestCase }, @document.data) end + should "output the collection name in the #to_liquid method" do + assert_equal @document.to_liquid['collection'], "methods" + end + end context " a document part of a rendered collection" do