diary uses title from entry for snippets

small-nav
Mimi Momo 4 years ago
parent 47d60026f0
commit 92c7389e5c

@ -18,17 +18,21 @@ def list_snippets(articles):
limit = 4 limit = 4
total = len(articles) total = len(articles)
head = count_lines('entries/raw/res/head.txt') head = count_lines('entries/raw/res/head.txt')
print(head)
result = [] result = []
for article in articles: for article in articles:
article = [] text = []
article.append("title") a = []
article.append(snip_article("words words words"))
article.append("11/22/33") with open('entries/feature/' + article) as f:
article.append("social") text = f.readlines()
article.append("link")
result.append(article) 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 return result
def count_lines(fname): def count_lines(fname):

Loading…
Cancel
Save