|
|
|
@ -46,6 +46,7 @@ def get_md_contents(filename, directory='./contents'):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def render_home():
|
|
|
|
|
print('Rendering home...')
|
|
|
|
|
with open(app.root_path + 'render.html', 'w') as f:
|
|
|
|
|
# get the basic info of the website from the /contents/home.md file
|
|
|
|
|
meta, content = get_md_contents("home.md")
|
|
|
|
@ -70,6 +71,7 @@ def render_home():
|
|
|
|
|
"projects": projects_list
|
|
|
|
|
}
|
|
|
|
|
f.write(render_template("home.html", **home))
|
|
|
|
|
print('Rendered!')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# FLASK APP
|
|
|
|
@ -146,8 +148,9 @@ def pull():
|
|
|
|
|
|
|
|
|
|
@app.route('/api/render/')
|
|
|
|
|
def render():
|
|
|
|
|
print('Request for rendering')
|
|
|
|
|
render_home()
|
|
|
|
|
return 'rendered'
|
|
|
|
|
return redirect(url_for('home_page'))
|
|
|
|
|
|
|
|
|
|
# RUN
|
|
|
|
|
app.run(port="3132")
|
|
|
|
|