mirror of
https://github.com/welpo/tabi.git
synced 2026-06-13 23:07:36 +02:00
✨ feat(meta): allow overriding reading time setting from post
Also hides the separator if reading time is not shown.
This commit is contained in:
parent
497fe9d127
commit
eeab0a03dd
3 changed files with 9 additions and 3 deletions
|
|
@ -186,6 +186,7 @@ stylesheets = []
|
||||||
copy_button = true
|
copy_button = true
|
||||||
|
|
||||||
# Show the reading time of a page.
|
# Show the reading time of a page.
|
||||||
|
# Can also be enabled or disabled on individual pages in the front matter's [extra].
|
||||||
show_reading_time = true
|
show_reading_time = true
|
||||||
|
|
||||||
# Adds backlinks to footnotes (loads ~500 bytes of JavaScripts).
|
# Adds backlinks to footnotes (loads ~500 bytes of JavaScripts).
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,12 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if page.date %}
|
{% if page.date %}
|
||||||
<li>{{ macros_format_date::format_date(date=page.date, short=true) }} {{ separator }}</li>
|
<li>{{ macros_format_date::format_date(date=page.date, short=true) }}</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if page.extra.show_reading_time %}
|
{# page settings override config settings #}
|
||||||
<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 | default(value="") == true or page.extra.show_reading_time | default(value="") != false and config.extra.show_reading_time | default(value=true) %}
|
||||||
|
{{ separator }} <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 %}
|
||||||
|
|
||||||
{% if page.taxonomies and page.taxonomies.tags %}
|
{% if page.taxonomies and page.taxonomies.tags %}
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,10 @@ 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.
|
||||||
|
# Can also be enabled or disabled on individual pages in the front matter's [extra].
|
||||||
|
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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue