Hello,
I use grav with webfolio theme.
I've creating a "blog" page and an "blog-post" page in this blog, with an image in the same directory of my blog-post.
Byt the image do not display when I consult the blog page.
The variable : post.media[post.header.image] seems to be empty ...
Here is code from the blog.html.twig 🙂
{% extends 'partials/base.html.twig' %}
{% set posts = page.header.content ? page.collection : page.children %}
{% block content %}
<section class="blog">
<section class="container">
{{ content|raw }}
<section class="blog__cards">
{% for post in posts.published %}
<a class="blog__card__link" href="{{ post.url }}">
<div class="blog__card">
{{ post.media[post.header.image].html('', post.header.title ~ ' image', 'blog__card__img') }}
<div class="blog__card__content {% if not post.media[post.header.image] %} no-img {% endif %}">
<h3 class="blog__card__title">
{{ post.header.title }}
</h3>
<div class="blog__card__date">
{% set date_format = page.dateformat ? page.dateformat : system.pages.dateformat.short %}
{{ post.date|date(date_format) }}
</div>
<div class="blog__card__preview">
{{ post.summary|striptags }}
</div>
</div>
</div>
</a>
{% endfor %}
</section>
</section>
</section>
{% endblock %}