Reputation: 149
I've made a Jekyll static web site following this tutorial. The problem is when I reach the collections's section, I do what is being told but my 'portfolio' collection is not rendering.
These are the Markdown files that composes the collection _portfolio
.
For example, the file called google.md
has this content:
---
image_path: /img/portfolio/1.jpg
category: Diseño web
project_name: Google
link: https://google.com
---
As well the other files, but with different data.
My config.yml
just has this:
collections:
portfolio:
And portfolio.html
has this code:
---
layout: page
title: Portafolio
---
<section class="no-padding" id="portfolio">
<div class="container-fluid">
<div class="row no-gutter">
{%- for item in site.portfolio -%}
<div class="col-lg-4 col-sm-6">
<a href="{{ item.link }}" class="portfolio-box">
<img src="{{ item.image_path }}" class="img-responsive" alt="{{ item.project_name }}">
<div class="portfolio-box-caption">
<div class="portfolio-box-caption-content">
<div class="project-category text-faded">
{{ item.category }}
</div>
<div class="project-name">
{{ item.project_name }}
</div>
</div>
</div>
</a>
</div>
{%- endfor -%}
</div>
</div>
</section>
When I inspected the elements in the console y noticed that the page is rendering everything but the content after the {% for %}
tag.
What am I missing? Are the Markdown files wrong or is it the 'for' tag?
EDIT: This is the repository link
Upvotes: 1
Views: 638
Reputation: 52789
It seems that your collection.docs
array is empty, so, no way to loop in.
You need to generate your documents.
Can you try :
collections:
portfolio:
output: true
Edit : And your configuration file must be named _config.yml and NOT config.yml.
Upvotes: 1