"""
    Entry point and the only view we have.
"""

from .article_utils import get_articles

from flask import Flask, render_template
from os import path

app = Flask(__name__)

config_path = path.abspath(path.join(path.dirname(__file__), 'config.py'))
app.config.from_pyfile(config_path)


@app.route('/')
def frontpage():
    articles = get_articles()
    context = {
        'articles': articles,
        'debug': app.config.get('DEBUG', False),
    }
    return render_template('home.html', **context)


@app.route('/about')
def about():
    return render_template('about.html', title="Robert :: About")


"""
    Entry point and the only view we have.
"""

from .article_utils import get_articles

from flask import Flask, render_template
from os import path

app = Flask(__name__)

config_path = path.abspath(path.join(path.dirname(__file__), 'config.py'))
app.config.from_pyfile(config_path)


@app.route('/')
def frontpage():
    articles = get_articles()
    context = {
        'articles': articles,
        'debug': app.config.get('DEBUG', False),
    }
    return render_template('home.html', **context)


@app.route('/about.html')
def about():
    return render_template('about.html', title="Robert :: About")


Change URL of about page -> /about.html
Change URL of about page -> /about.html

Since we can't control the web server serving this at GitHub Pages, we
can't setup proper URL rewriting to get rid of the extension. Ugly, but
keeps us from moving back to self-hosted site.
