25 lines
630 B
Python
Executable File
25 lines
630 B
Python
Executable File
from flask import Flask, render_template, json
|
|
from flask_misaka import markdown
|
|
|
|
import glob
|
|
|
|
app = Flask(__name__)
|
|
contact_data = json.load(open("data/contact.json"))
|
|
writings = []
|
|
|
|
for filename in glob.iglob("writings/**/*.md", recursive = True):
|
|
# TODO: split into parent dir and filename
|
|
writings.append(filename)
|
|
|
|
@app.route("/")
|
|
def render_home():
|
|
return render_template("home.html", big_header = True)
|
|
|
|
@app.route("/contact")
|
|
def render_contact():
|
|
return render_template("contact.html", data = contact_data)
|
|
|
|
@app.route("/writings")
|
|
def render_writings():
|
|
return render_template("writings.html", writings = writings)
|