forked from MLH/mlh-hackathon-flask-starter
/
public.py
26 lines (21 loc) · 868 Bytes
/
public.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from flask import Blueprint, render_template
from starter.extensions import markdown
blueprint = Blueprint('public', __name__)
@blueprint.route('/')
def index():
with open('README.md', 'r') as input_file:
text = input_file.read()
content = markdown.render(text)
return render_template('home/index.html', body=content)
@blueprint.route('/user-guide')
def user_guide():
with open('starter/docs/USER_GUIDE.md', 'r') as input_file:
text = input_file.read()
content = markdown.render(text)
return render_template('home/index.html', body=content)
@blueprint.route('/getting-started')
def getting_started():
with open('starter/docs/GETTING_STARTED.md', 'r') as input_file:
text = input_file.read()
content = markdown.render(text)
return render_template('home/index.html', body=content)