From 92c7389e5c04c8077b8bafed2dc9b8262d5b3314 Mon Sep 17 00:00:00 2001 From: Mimi Momo Date: Fri, 25 Sep 2020 16:45:07 -0500 Subject: [PATCH] diary uses title from entry for snippets --- src/index.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/index.py b/src/index.py index 93168cf..c346ffb 100644 --- a/src/index.py +++ b/src/index.py @@ -18,17 +18,21 @@ def list_snippets(articles): limit = 4 total = len(articles) head = count_lines('entries/raw/res/head.txt') - print(head) result = [] for article in articles: - article = [] - article.append("title") - article.append(snip_article("words words words")) - article.append("11/22/33") - article.append("social") - article.append("link") - result.append(article) + text = [] + a = [] + + with open('entries/feature/' + article) as f: + text = f.readlines() + + a.append(text[head]) + a.append(snip_article("words words words")) + a.append("11/22/33") + a.append("social") + a.append("link") + result.append(a) return result def count_lines(fname):