Data from collection not showing on template
clluiz opened this issue · comments
Cleiton Luiz Rocha Teodoro commented
Operating system
ubuntu 22
Eleventy
2.0.0
Describe the bug
I have a project with the following structure:
src
|-_data
|----projects.json
|-_includes
|----portfolio.njk
<ul>
{% for project in projects %}
<li>
<p>{{ project.name }}</p>
<p>{{ project.data.description | i18n }}</p>
{% for tech in project.data.tech %}
<span class="inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700 mr-2 mb-2">{{ tech }}</span>
{% endfor %}
<li>
{% endfor %}
</ul>
In my index.njk I have the code:
...
<section>
{% include "portfolio.njk" %}
</section>
...
When I render my application the data on projects.json don't show up.
What I'm doing wrong?
Cleiton Luiz Rocha Teodoro commented
Solved. I little typo in my code.