Merge pull request #2436 from budparr/documenttoliquid

This commit is contained in:
Parker Moore 2014-06-04 14:16:22 -04:00
commit 4e26874298
3 changed files with 16 additions and 1 deletions

View File

@ -206,7 +206,8 @@ module Jekyll
"content" => content, "content" => content,
"path" => path, "path" => path,
"relative_path" => relative_path, "relative_path" => relative_path,
"url" => url "url" => url,
"collection" => collection.label
} }
else else
data data

View File

@ -244,6 +244,16 @@ In addition to any YAML front-matter provided in the document's corresponding fi
</p> </p>
</td> </td>
</tr> </tr>
<tr>
<td>
<p><code>collection</code></p>
</td>
<td>
<p>
The name of the document's collection.
</p>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -40,6 +40,10 @@ class TestDocument < Test::Unit::TestCase
}, @document.data) }, @document.data)
end end
should "output the collection name in the #to_liquid method" do
assert_equal @document.to_liquid['collection'], "methods"
end
end end
context " a document part of a rendered collection" do context " a document part of a rendered collection" do