tabi/templates/macros
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
..
add_comments.html 🚸 feat: add JavaScript notice for comments 2023-07-27 00:42:51 +02:00
cards_pages.html 🐛 fix: handle missing image metadata gracefully 2023-04-16 18:06:20 +02:00
content.html Support hiding the read time indication on pages 2023-08-30 19:57:16 +01:00
create_history_url.html ♻️ refactor(HTML): use whitespace control 2023-08-28 18:24:40 +02:00
format_date.html 🐛fix(format_date): actually use short_date_format (#119) 2023-08-28 12:43:09 +02:00
list_posts.html 💄 style: standardise posts' summary & description 2023-08-15 20:27:30 +02:00
page_desc.html ♻️ refactor: improve spacing and indentation 2023-03-06 00:20:31 +01:00
page_header.html ♻️ refactor: improve spacing and indentation 2023-03-06 00:20:31 +01:00
paginate.html feat: add multi-language support 2023-05-22 19:12:03 +02:00
set_title.html feat: add multi-language support 2023-05-22 19:12:03 +02:00
table_of_contents.html 🐛 fix: check proper toc_ignore_pattern 2023-08-16 02:02:31 +02:00