I'm building pages (not posts) in Jekyll. One page defines 2 categories in the front-matter as follows:
categories: [document, new]
And then in a layout I'm trying to output the categories object/array, but nothing is being output:
<h1>Array: {{ site.categories }}</h1>
Why wouldn't this output an array as expected?
Only post's categories are used to populate site.categories
array.
In a page, the only way to access categories, from the front matter, is {% for category in page.categories %}
. And to scope is restricted to the page itself. :-(
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With