snippets are cleaned of <br>s, snipped to given length; need to remove more tags, figure out why tags do nothing for everything but content

small-nav
Mimi Momo 4 years ago
parent 3ea1b5ba20
commit 6f7c00d158

@ -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('<br>','')
result = result.rsplit(' ',1)[0]
return result + " ... "
def sort_files(files):

@ -19,7 +19,7 @@
{{s[2]}}{{s[3]}}
</div>
<div class="snippet-link">
<a href={{s[4]}}>... Read More</a>
<a href={{s[4]}}>Read More</a>
</div>
</div>
% end

Loading…
Cancel
Save