In each of my Jekyll posts, I have a number listed in the front matter:
---
minutes: X
---
The value is always different from post-to-post and I would like to find the sum of all the posts.
Not sure if this is possible or what the approach should be.
Thanks for any help in advance!
Try:
{% assign total = 0 %}
{% for post in site.posts %}
{% assign total = total | plus: post.minutes %}
{% endfor %}
{{ total }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With