I have a layout used for the home page for different sections on my Jekyll site. On each of these pages, I would like to have links to each element of the section, the details of which are stored in the YAML file in the site directory _data. My goal is to have the name of the site data variable in the main section of the section and pass this to the layout for rendering. For instance:
Front Matter Page
---
sectionItems: site.data.sectionItems.awesomeSectionItems
---
... which is passed to the layout of the main section ...
Splitting the main layout
{% for item in page.sectionItems %}
{% endfor %}
Unfortunately, when the site starts, nothing appears. How should I do it? I also tried turning it on, but this also does not work. I would like to avoid adding a for loop to each page, plus I would like the links to appear below the main content section.
source
share