|
|
@ -1,7 +1,7 @@
|
|
|
|
import datetime, os
|
|
|
|
import datetime, os
|
|
|
|
from bottle import route, run, template
|
|
|
|
from bottle import route, run, template
|
|
|
|
|
|
|
|
|
|
|
|
# diary
|
|
|
|
# write diary
|
|
|
|
|
|
|
|
|
|
|
|
def build_nav():
|
|
|
|
def build_nav():
|
|
|
|
return "nav"
|
|
|
|
return "nav"
|
|
|
@ -51,19 +51,16 @@ def find_content(article, length, head, tail):
|
|
|
|
return content
|
|
|
|
return content
|
|
|
|
|
|
|
|
|
|
|
|
def snip_article(article):
|
|
|
|
def snip_article(article):
|
|
|
|
# read text in article
|
|
|
|
limit = 300
|
|
|
|
# clean 250 first characters
|
|
|
|
cut = article[0:min(len(article),limit)]
|
|
|
|
# add to snippet
|
|
|
|
result = cut.rsplit(' ',1)[0]
|
|
|
|
# add "read more" button that links to article to snippet
|
|
|
|
return result + " ... "
|
|
|
|
return article
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def sort_files(files):
|
|
|
|
def sort_files(files):
|
|
|
|
# sort array so articles are latest to earliest
|
|
|
|
|
|
|
|
m = list(reversed(files))
|
|
|
|
m = list(reversed(files))
|
|
|
|
return files
|
|
|
|
return files
|
|
|
|
|
|
|
|
|
|
|
|
def gather_files():
|
|
|
|
def gather_files():
|
|
|
|
# directory to list
|
|
|
|
|
|
|
|
return os.listdir('entries/feature/')
|
|
|
|
return os.listdir('entries/feature/')
|
|
|
|
|
|
|
|
|
|
|
|
# Webpages
|
|
|
|
# Webpages
|
|
|
|