commit 0a6ea0bb9de600d21cacd985f676eccfa05a185e
parent aae5134f12a6f1b766ddb5a3c2b74ef2b7f981c2
Author: Oscar Benedito <oscar@oscarbenedito.com>
Date:   Thu, 25 Mar 2021 10:47:22 +0100

Remove read time from post summary

Diffstat:
Mgensite.py | 6+-----
Mlayouts/item.html | 2+-
2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/gensite.py b/gensite.py @@ -207,11 +207,7 @@ def make_pages(src, dst, layout, blog=False, **params): page_params.update({'url': page_dst}) if blog: - w = int(len(re.sub('(?s)<.*?>', ' ', page_params['content']).split())/140) - page_params.update({ - 'read_time': str(w) + ' minutes' if w > 1 else '1 minute', - 'src_path': src_path, - }) + page_params.update({ 'src_path': src_path, }) items.append(page_params) else: fwrite(page_dst, render(layout, **page_params)) diff --git a/layouts/item.html b/layouts/item.html @@ -1,7 +1,7 @@ <article class="summary h-entry"> <header> <h2><a class="u-url p-name" href="/{{ url }}">{{ title }}</a></h2> - <p class="metadata">{{ categories_html }} &middot; <time class="dt-published" datetime="{{ date }}">{{ date_nice }}</time> &middot; {{ read_time }}</p> + <p class="metadata">{{ categories_html }} &middot; <time class="dt-published" datetime="{{ date }}">{{ date_nice }}</time></p> </header> <p class="p-summary">{{ summary }} <a href="/{{ url }}" aria-label="Read post {{ title }}">Read more</a></p> </article>