Merge pull request #2436 from budparr/documenttoliquid
This commit is contained in:
commit
4e26874298
|
@ -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
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue