Hi, I'd like to know how to add the correct reading time in a blog list page. If I use page.content.readingtime it calculates the reading time of the list page, not the time of the single blog post page. I don't know how to tell Grav to do that. Is that even possible?
@marcocevoli, Do you mean something like the following, where each blog item in the blog list shows its own reading time?
<pre>
<br/>
</pre>
If so, you should add the the code snippet {{ page.content|readingtime }} to the template that draws the list items. In Quark that would be '/partials/blog-list-item.html.twig'
That's what I did. Actually, I have the list created inside a blog template, such as:
TWIG
<section><divclass="container"><divclass="row">{%forchildincollection%}<!-- Single Blog Grid --><divclass="col-lg-6 col-md-6"><divclass="blog-grid-wrap mb-4"><divclass="blog-grid-thumb"><ahref="{{child.url}}"><imgsrc="{{child.media.images|first.cropZoom(1920,900).cache.url()}}"class="img-responsive"alt="" /></a><divclass="bg-cat-info"><h6>{%forcatinchild.header.taxonomy.category%}{{cat}}{%ifnotloop.last%},{%endif%}{%endfor%}</h6><span>{{child.header.date|date('d')}}{{'GRAV.MONTHS_OF_THE_YEAR'|ta(child.header.date|date('n') - 1)}}{{child.header.date|date('Y')}}</span></div></div><divclass="blog-grid-content"><h4class="cnt-gb-title"><ahref="{{child.url}}">{{child.title}}</a></h4><p>{{child.summary(110)}}</p></div><divclass="blog-grid-meta"><divclass="gb-info-author"><p><strong>{{'THEME_UNICO.SITE.BY'|t}}</strong>{{child.header.author}}</p></div></div></div></div>{%endfor%}</div>
If I put that snippet, I get the same reading time for all pages... I don't know what I'm doing wrong...