Why is the site.categories array not showing up in Jekyll?

I was building pages (not posts) in Jekyll. One page defines 2 categories in the front end as follows:

categories: [document, new]

      

And then in layout, I try to output the category object / array, but nothing is output:

<h1>Array: {{ site.categories }}</h1>

      

Why doesn't this output the array as expected?

+3


source to share


1 answer


site.categories

Only columnar categories are used to populate the array .



On the page, the only way to access the categories from the front is {% for category in page.categories %}

. And the page itself is limited to the scope.: - (

+1


source







All Articles