From b745d2d7b3f9d47f0a73e26e75e1a55b9bb670b4 Mon Sep 17 00:00:00 2001 From: kogeletey <kg@re128.org> Date: Tue, 14 Sep 2021 14:27:23 +0300 Subject: [PATCH] root: config.toml new settings `show_word_count` and `show_reading_time` allowing you to show the number of words and the time of reading it on the page, respectively. templates: page add implementation previos paragraph settings. sass: improved indents --- config.toml | 2 ++ sass/src/_page.scss | 7 ++++++- templates/page.html | 13 +++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/config.toml b/config.toml index 3fab18d..4ec83ef 100755 --- a/config.toml +++ b/config.toml @@ -27,6 +27,8 @@ render_emoji = true version = "https://api.github.com/repos/kogeletey/karzok/releases/latest" cdnurl = "https://get.re128.net/" +show_word_count = true +show_reading_time = true [[extra.header]] text = "Meta" diff --git a/sass/src/_page.scss b/sass/src/_page.scss index 5fe0496..ffb851b 100644 --- a/sass/src/_page.scss +++ b/sass/src/_page.scss @@ -103,7 +103,12 @@ display: flex; flex-wrap: wrap; li { + display: flex; list-style: none; - padding-left: 1em; + padding-right: 1em; + } + &-author { + padding-right: 0; + padding-left: 0.5em; } } diff --git a/templates/page.html b/templates/page.html index 697afa4..bcf250e 100644 --- a/templates/page.html +++ b/templates/page.html @@ -10,12 +10,21 @@ <h1 class="page-title"> {{ page.title }} </h1> {% block sections %} <ul class="sections"> + {% if config.extra.render_path %} + <li> <a href="{{ page.permalink }}">/{{ page.relative_path | trim_end_matches(pat=".md") }}</a></li> + {% endif %} + {% if config.extra.show_word_count %} + <li> <span> {{ page.word_count }} words </span></li> + {% endif %} + {% if config.extra.show_reading_time %} + <li> <span> {{ page.reading_time}} minutes to read </span></li> + {% endif %} {% if page.taxonomies.authors %} - <span> Authors: </span> + <span> Authors: </span> {% for author in page.taxonomies.authors %} <li> <!-- <a href="{{ get_taxonomy_url(kind="authors",name=author) | safe }}"> --> - <span>{{ author }}</span> + <span class="sections-author">{{ author }}</span> <!-- </a> --> </li> {% endfor %} -- GitLab