From 089755c89f3bc2d40ad09ab2db7d3a9a4e2804c5 Mon Sep 17 00:00:00 2001 From: daudix Date: Sat, 20 Jul 2024 23:00:11 +0300 Subject: [PATCH] Add estimated read time counter, remove tags from the post Shoutout to Cassidy for https://cassidyjames.com/blog/read-time-estimate-jekyll/ --- config.toml | 4 ++++ i18n/ar.toml | 2 ++ i18n/en.toml | 2 ++ i18n/ru.toml | 3 +++ templates/article.html | 23 +++++++++++------------ 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/config.toml b/config.toml index b85219c..a37976d 100644 --- a/config.toml +++ b/config.toml @@ -82,6 +82,10 @@ source_url = "https://codeberg.org/daudix/duckquill" # that have the language set. # See https://www.getzola.org/documentation/content/syntax-highlighting/ show_copy_button = true +# Whether to show estimated read time in posts. +# Calculated using the simple math: number of words ÷ words per minute. +show_read_time = true +# words_per_minute = "200" [extra.nav] # Whether to show Atom/RSS feed button in the nav diff --git a/i18n/ar.toml b/i18n/ar.toml index d69cb07..9faf2af 100644 --- a/i18n/ar.toml +++ b/i18n/ar.toml @@ -36,6 +36,8 @@ important = "مهم" language = "اللغة" load_comments = "تحميل التعليقات" loading = "التحميل" +many_minutes_read = "$NUMBER دقائق القراءة" +minutes_read = "$NUMBER دقائق القراءة" newest_to_oldest = "من الأحدث إلى الأقدم" next = "التالي" note = "ملاحظة" diff --git a/i18n/en.toml b/i18n/en.toml index 747aff3..b733672 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -36,8 +36,10 @@ important = "Important" language = "Language" load_comments = "Load Comments" loading = "Loading" +many_minutes_read = "$NUMBER minutes read" many_posts = "$NUMBER posts in total" many_tags = "$NUMBER tags in total" +minutes_read = "$NUMBER minute read" newest_to_oldest = "From newest to oldest" next = "Next" note = "Note" diff --git a/i18n/ru.toml b/i18n/ru.toml index 7668d30..c5a5c0f 100644 --- a/i18n/ru.toml +++ b/i18n/ru.toml @@ -70,3 +70,6 @@ updated = "Обновлено" view_comment = "Показать комментарий на" view_profile = "Показать профиль на" warning = "Внимание" +minutes_read = "$NUMBER минута чтения" +few_minutes_read = "$NUMBER минут чтения" +many_minutes_read = "$NUMBER минуты чтения" diff --git a/templates/article.html b/templates/article.html index f741814..48544ae 100644 --- a/templates/article.html +++ b/templates/article.html @@ -12,18 +12,6 @@

{{ page.title }}

- {%- if page.taxonomies -%} - {%- for name, taxon in page.taxonomies -%} - - {%- endfor -%} - {%- endif -%} - {%- if page.date -%} {%- endif -%}