Code cleanup to pass travis checks.

pull/24/head
Markus Steinlein 4 years ago committed by Markus Steinlein
parent e3804e883d
commit 4b3d4023a3

@ -5,7 +5,6 @@ from flask_flatpages import FlatPages
from flask_flatpages.utils import pygmented_markdown from flask_flatpages.utils import pygmented_markdown
from flask_fontawesome import FontAwesome from flask_fontawesome import FontAwesome
from datetime import datetime from datetime import datetime
from fotogrid import fotogrid from fotogrid import fotogrid
# directly support jinja within markdown blogposts # directly support jinja within markdown blogposts
@ -14,10 +13,13 @@ def markdown_with_jinja_renderer(text):
prerendered_body = render_template_string(text) prerendered_body = render_template_string(text)
return pygmented_markdown(prerendered_body) return pygmented_markdown(prerendered_body)
# function to reformat date from blog posts for better visualization on the pages
def format_date_string(date_string): def format_date_string(date_string):
date = datetime.strptime(date_string, "%d.%m.%Y") date = datetime.strptime(date_string, "%d.%m.%Y")
return date.strftime("%d. %B %Y") return date.strftime("%d. %B %Y")
# create app # create app
app = Flask(__name__) app = Flask(__name__)
app.config['FLATPAGES_EXTENSION'] = '.md' app.config['FLATPAGES_EXTENSION'] = '.md'
@ -62,7 +64,5 @@ def index():
return render_template('index.html', pages=sorted_pages) return render_template('index.html', pages=sorted_pages)
if __name__ == '__main__': if __name__ == '__main__':
app.run(host='0.0.0.0') app.run(host='0.0.0.0')

Loading…
Cancel
Save