From 6f7c00d1588db9afeb48b8cd37d4fb6abbbe4f07 Mon Sep 17 00:00:00 2001 From: Mimi Momo Date: Fri, 25 Sep 2020 23:33:09 -0500 Subject: [PATCH] snippets are cleaned of
s, snipped to given length; need to remove more tags, figure out why tags do nothing for everything but content --- src/index.py | 7 ++++--- src/views/diary.tpl | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/index.py b/src/index.py index 4cd26bb..d9989bc 100644 --- a/src/index.py +++ b/src/index.py @@ -46,14 +46,15 @@ def find_content(article, length, head, tail): content = "" with open('entries/feature/' + article) as f: for pos, line in enumerate(f): - if pos > head and pos < length - tail: + if pos > head + 1 and pos < length - tail: content += line return content def snip_article(article): limit = 300 - cut = article[0:min(len(article),limit)] - result = cut.rsplit(' ',1)[0] + result = article[0:min(len(article),limit)] + result = result.replace('
','') + result = result.rsplit(' ',1)[0] return result + " ... " def sort_files(files): diff --git a/src/views/diary.tpl b/src/views/diary.tpl index 731fa56..003b156 100644 --- a/src/views/diary.tpl +++ b/src/views/diary.tpl @@ -19,7 +19,7 @@ {{s[2]}} • {{s[3]}} % end