tabi/templates
Steven Roose 497fe9d127
Support hiding the read time indication on pages
diff --git a/config.toml b/config.toml
index d1885fe..9fe31bf 100644
--- a/config.toml
+++ b/config.toml
@@ -185,6 +185,9 @@ stylesheets = []
 # Add a "copy" button to codeblocks (loads ~700 bytes of JavaScript).
 copy_button = true

+# Show the reading time of a page.
+show_reading_time = true
+
 # Adds backlinks to footnotes (loads ~500 bytes of JavaScripts).
 footnote_backlinks = false

diff --git a/templates/macros/content.html b/templates/macros/content.html
index 4c42835..b7bb86d 100644
--- a/templates/macros/content.html
+++ b/templates/macros/content.html
@@ -17,7 +17,9 @@
                 <li>{{ macros_format_date::format_date(date=page.date, short=true) }} {{ separator }}</li>
             {% endif %}

-            <li title="{{ page.word_count }} {%- if lang != config.default_language %} {{ trans(key="words" | safe, lang=lang) }} {% else %} words {% endif %}">&nbsp;{{ page.reading_time }}{%- if lang != config.default_language %} {{ trans(key="min_read" | safe, lang=lang) }} {% else %} min read {% endif %}</li>
+            {% if page.extra.show_reading_time %}
+                <li title="{{ page.word_count }} {%- if lang != config.default_language %} {{ trans(key="words" | safe, lang=lang) }} {% else %} words {% endif %}">&nbsp;{{ page.reading_time }}{%- if lang != config.default_language %} {{ trans(key="min_read" | safe, lang=lang) }} {% else %} min read {% endif %}</li>
+            {% endif %}

             {% if page.taxonomies and page.taxonomies.tags %}
                 <li>&nbsp;{{ separator }}&nbsp;{%- if lang != config.default_language -%}{{ trans(key="tags" | safe, lang=lang) | capitalize }}{% else %}Tags{%- endif -%}:&nbsp;</li>
2023-08-30 19:57:16 +01:00
..
macros Support hiding the read time indication on pages 2023-08-30 19:57:16 +01:00
partials ♻️ refactor(HTML): use whitespace control 2023-08-28 18:24:40 +02:00
shortcodes feat(image shortcodes): add lazy loading (#116) 2023-08-26 01:57:19 +02:00
tags feat: add multi-language support 2023-05-22 19:12:03 +02:00
404.html 🐛 fix: mention translations in 404 if there's more than 1 language 2023-05-30 14:01:25 +02:00
anchor-link.html 💄 style: set custom header anchor 2023-06-18 23:13:37 +02:00
archive.html feat: add multi-language support 2023-05-22 19:12:03 +02:00
atom.xml feat: introduce skins to customise the theme (#105) 2023-08-10 13:21:52 +02:00
base.html feat: add link to commit history on updated articles (#109) 2023-08-15 02:02:23 +02:00
cards.html feat: allow dual date-format (short/long) 2023-03-10 23:25:54 +01:00
index.html 🐛 fix: add end-of-file newline 2023-02-06 02:20:56 +01:00
page.html ♻️ refactor: improve spacing and indentation 2023-03-06 00:20:31 +01:00
section.html feat: allow dual date-format (short/long) 2023-03-10 23:25:54 +01:00