|
|
|
@ -1,14 +1,39 @@
|
|
|
|
|
import datetime
|
|
|
|
|
from os import listdir
|
|
|
|
|
from bottle import route, run, template
|
|
|
|
|
|
|
|
|
|
# diary
|
|
|
|
|
|
|
|
|
|
def make_snippets():
|
|
|
|
|
def build_nav():
|
|
|
|
|
return "nav"
|
|
|
|
|
|
|
|
|
|
def list_snippets(articles):
|
|
|
|
|
# take articles between 0-4, 5-8, 9-13,...) based on current page
|
|
|
|
|
# for each one of those articles,
|
|
|
|
|
# snip_article(article)
|
|
|
|
|
limit = 4
|
|
|
|
|
total = len(files)
|
|
|
|
|
|
|
|
|
|
def snip_article(article):
|
|
|
|
|
# read text in article
|
|
|
|
|
# clean 250 first characters
|
|
|
|
|
# add to snippet
|
|
|
|
|
# add "read more" button that links to article to snippet
|
|
|
|
|
return "snippet"
|
|
|
|
|
|
|
|
|
|
def make_latest():
|
|
|
|
|
# for article in array (just 5 or something)
|
|
|
|
|
# link to webpage
|
|
|
|
|
return "latest"
|
|
|
|
|
|
|
|
|
|
def sort_files(files):
|
|
|
|
|
# sort array so articles are latest to earliest
|
|
|
|
|
return list(reversed(files))
|
|
|
|
|
|
|
|
|
|
def gather_files():
|
|
|
|
|
# directory to list
|
|
|
|
|
return os.listdir()
|
|
|
|
|
|
|
|
|
|
# Webpages
|
|
|
|
|
|
|
|
|
|
@route('/')
|
|
|
|
|