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
This commit is contained in:
+4
-3
@@ -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):
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user