From 54b74fafba7d42d54a22abf4cb41033900a9aa0e Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 4 May 2014 21:22:51 -0400 Subject: [PATCH] Add documents to site payload --- lib/jekyll/document.rb | 9 +++++++++ lib/jekyll/site.rb | 1 + 2 files changed, 10 insertions(+) diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index 0a75fe96..3b2b6eeb 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -228,5 +228,14 @@ module Jekyll path <=> anotherDocument.path end + # Determine whether this document should be written. + # Based on the Collection to which it belongs. + # + # True if the document has a collection and if that collection's #write? + # method returns true, otherwise false. + def write? + collection && collection.write? + end + end end diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 3f57a83f..0b785e51 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -325,6 +325,7 @@ module Jekyll "categories" => post_attr_hash('categories'), "tags" => post_attr_hash('tags'), "collections" => collections, + "documents" => documents, "data" => site_data })) }