diff --git a/src/index.py b/src/index.py index af972ed..05319cd 100644 --- a/src/index.py +++ b/src/index.py @@ -1,9 +1,6 @@ import datetime, os, re from bottle import error, route, run, static_file, template -# make article-to-html work with entries -# make index work with entries - later, they can be differentiated into features and weeklies with tags or title or whatever - def list_headlines(articles): head = count_lines('entries/raw/res/head.txt') result = [] @@ -17,7 +14,7 @@ def list_headlines(articles): b = [] b.append(path) - b.append(clean(text[head].replace('
',''), path)) + b.append(clean(text[head].replace('
',''))) result.append(b) return result @@ -61,7 +58,7 @@ def find_content(article, length, head, tail): content += line return content -def clean(result, path): +def clean(result): result = result.replace('
','') result = re.sub(r'', '', result) result = result.replace('','') @@ -70,7 +67,7 @@ def clean(result, path): return result def snip_article(article, path): - article = clean(article, path) + article = clean(article) limit = 300 result = article[0:min(len(article),limit)] result = result.rsplit(' ',1)[0]