feat(meta): allow hiding the read time indication on pages (#124)

Co-authored-by: welpo <welpo@users.noreply.github.com>
main
Steven Roose 2 years ago committed by GitHub
parent 0c87f6513b
commit b58225a012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -185,6 +185,10 @@ stylesheets = []
# Add a "copy" button to codeblocks (loads ~700 bytes of JavaScript).
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).
footnote_backlinks = false

@ -22,10 +22,13 @@
{% endif %}
{% 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 %}
<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>
{# page settings override config settings #}
{% 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 %}
{% 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>

@ -70,6 +70,10 @@ stylesheets = []
# Add a "copy" button to codeblocks (loads ~700 bytes of JavaScript).
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).
footnote_backlinks = false

Loading…
Cancel
Save