Hi,
I created the partial below which first checks if the readingtime plugin is enabled globally or just enabled on a page. Then I do a condition to check if the reading minutes are 0, if so, then don't display the reading time. But this is not efficient, the reading time of a page is now calculated twice. I tried to use {% set calculated_readingtime = page.content|readingtime %} and then I tried to use calculated_readingtime.split()[0] to get the first index of the list, which are the minutes. But the output remains blank. This is jinja2, right? In Ansible these things work as far as I remember. Any suggestions?
{% if config.get("plugins.readingtime.enabled") or attribute(page.header, "readingtime").active %}
{% if page.content|readingtime({'format': '{minutes_short_count}'}) != "0" %}
Geschatte leestijd is {{ page.content|readingtime }} ({{ config.plugins.readingtime.words_per_minute }} woorden per minuut).
{% endif %}
{% endif %}