Merge pull request #2436 from budparr/documenttoliquid
This commit is contained in:
commit
4e26874298
|
@ -206,7 +206,8 @@ module Jekyll
|
|||
"content" => content,
|
||||
"path" => path,
|
||||
"relative_path" => relative_path,
|
||||
"url" => url
|
||||
"url" => url,
|
||||
"collection" => collection.label
|
||||
}
|
||||
else
|
||||
data
|
||||
|
|
|
@ -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>collection</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
The name of the document's collection.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue