Limited the number of blog posts on the homepage for cleanliness
This commit is contained in:
parent
010a2395bd
commit
35aa3c63c2
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue