I am facing troubles to auto-generate Jekyll gallery for my portfolio.html file. I have stored portfolio landing pages in _clients folder on site root. The images for these landing pages are stored in {{site.baseurl}}/images/clients folder.
Here is my code for autogenerating portfolio gallery:
<section>
<div class="container">
<ul class="image-grid">
{% for client in site.clients %}
<li>
<a href="{{ site.baseurl }}{{ client.url }}">
<img src="{{ site.baseurl }}/images/clients/{{ client.image_path }}" class="img-responsive" alt="{{ post.alt }}">
<div class="details">
<div class="name">{{ client.name }}</div>
<div class="position">{{ client.subtitle }}</div>
</div>
</a>
</li>
{% endfor %}
<li class="filler"></li>
<li class="filler"></li>
</ul>
</div>
</section>
Now. here is my code for generating landing page when someone clicks on gallery image:
<section>
<div class="container">
{% if portfolio.heading %}
<h2>
<a href="{{ site.baseurl }}/portfolio/">{{ portfolio.heading }}</a> /
{{ page.title | capitalize }}
</h2>
{% endif %} {% if page.subtitle %}
<p class="subtext">{{ page.subtitle }}</p>
{% endif %}
</div>
</section>
<section>
<div class="container">
<p>
<img
src="{% include relative-src.html src=page.image_path %}"
class="screenshot"
/>
</p>
<div>
{{ content }}
</div>
<p>
<a href="{{ page.external_url }}">View {{ page.title }} →</a>
</p>
</div>
</section>
Here's how font yml of client.md file looks like:
---
name:
subtitle:
external_url:
image_path:
---