Added templates

This commit is contained in:
Felipe Martín 2015-12-02 23:34:13 +01:00
parent 97329994f6
commit 79dd3339d1
9 changed files with 43 additions and 4 deletions

View File

@ -0,0 +1,8 @@
<html>
<head>
<title>{{ page_title }}</title>
</head>
<body>
{% block main_content %}{% endblock %}
</body>
</html>

View File

@ -0,0 +1 @@
{% extends "_base.html" %}

View File

@ -0,0 +1,5 @@
{% extends "blog/_base.html" %}
{% block main_content %}
Blog, page {{ page }}
{% endblock %}

View File

@ -0,0 +1,5 @@
{% extends "blog/_base.html" %}
{% block main_content %}
Blog post: {{ year }}, {{ month }}, {{ day }}, {{ slug }}
{% endblock %}

View File

@ -0,0 +1,5 @@
{% extends "_base.html" %}
{% block main_content %}
Home
{% endblock %}

View File

@ -0,0 +1,5 @@
{% extends "_base.html" %}
{% block main_content %}
portfolio
{% endblock %}

View File

@ -1,11 +1,16 @@
# -*- coding: utf-8 -*-
from flask import render_template, request
from .. import app
@app.route('/blog/<int:year>/<int:month>/<int:day>/<slug>/')
def blog_post(year, month, day, slug):
return ', '.join([str(var) for var in locals().values()])
return render_template('blog/post.html', **locals())
@app.route('/blog/')
def blog_list():
return 'blog list'
context = {
'page': request.args.get('page', 1)
}
return render_template('blog/list.html', **context)

View File

@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
from flask import render_template
from .. import app
@app.route('/')
def home():
return 'Sort for about page for the home'
return render_template('home.html')

View File

@ -1,7 +1,10 @@
# -*- coding: utf-8 -*-
from flask import render_template
from .. import app
@app.route('/projects/')
def portfolio_list():
return 'project list'
context = {}
return render_template('portfolio.html', **context)