mirror of
https://github.com/welpo/tabi.git
synced 2026-06-13 23:07:36 +02:00
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 %}"> {{ 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 %}"> {{ 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> {{ separator }} {%- if lang != config.default_language -%}{{ trans(key="tags" | safe, lang=lang) | capitalize }}{% else %}Tags{%- endif -%}: </li>
This commit is contained in:
parent
cf95506d08
commit
497fe9d127
2 changed files with 4 additions and 1 deletions
|
|
@ -185,6 +185,9 @@ stylesheets = []
|
||||||
# Add a "copy" button to codeblocks (loads ~700 bytes of JavaScript).
|
# Add a "copy" button to codeblocks (loads ~700 bytes of JavaScript).
|
||||||
copy_button = true
|
copy_button = true
|
||||||
|
|
||||||
|
# Show the reading time of a page.
|
||||||
|
show_reading_time = true
|
||||||
|
|
||||||
# Adds backlinks to footnotes (loads ~500 bytes of JavaScripts).
|
# Adds backlinks to footnotes (loads ~500 bytes of JavaScripts).
|
||||||
footnote_backlinks = false
|
footnote_backlinks = false
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<li>{{ macros_format_date::format_date(date=page.date, short=true) }} {{ separator }}</li>
|
<li>{{ macros_format_date::format_date(date=page.date, short=true) }} {{ separator }}</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if !page.extra.skip_readtime %}
|
{% 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 %}"> {{ page.reading_time }}{%- if lang != config.default_language %} {{ trans(key="min_read" | safe, lang=lang) }} {% else %} min read {% endif %}</li>
|
<li title="{{ page.word_count }} {%- if lang != config.default_language %} {{ trans(key="words" | safe, lang=lang) }} {% else %} words {% endif %}"> {{ page.reading_time }}{%- if lang != config.default_language %} {{ trans(key="min_read" | safe, lang=lang) }} {% else %} min read {% endif %}</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue