Limited the number of blog posts on the homepage for cleanliness

This commit is contained in:
William Brawner 2016-03-16 23:12:15 -07:00
parent 010a2395bd
commit 35aa3c63c2

View file

@ -36,7 +36,7 @@ class ContactForm(Form):
@app.route('/') @app.route('/')
def home(): def home():
g.db.execute('SELECT * FROM blog_posts ORDER BY updated_on DESC') g.db.execute('SELECT * FROM blog_posts ORDER BY updated_on DESC LIMIT 3')
entries = [dict(title=row[1], text=row[2], url=row[5], created=row[6].strftime("%B %d, %Y"), updated=row[7].strftime("%B %d, %Y")) for row in g.db.fetchall()] entries = [dict(title=row[1], text=row[2], url=row[5], created=row[6].strftime("%B %d, %Y"), updated=row[7].strftime("%B %d, %Y")) for row in g.db.fetchall()]
return render_template('home.html', entries=entries) return render_template('home.html', entries=entries)