You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: section14/projects/first-flask-app-lectures/9-adding-home-link/templates/home.jinja2
+6-14Lines changed: 6 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,13 @@
2
2
3
3
{%blockcontent%}
4
4
<h1>Welcome to your blog.</h1>
5
-
<h2>Posts</h2> <!-- Here we've got a slightly smaller heading -->
6
-
<ul> <!-- This bullet point list will show a link for each post. -->
7
-
{%forpost_id, postinposts.items() %}<!-- This is very similar to Python, but it's a Jinja2 for loop—looks the same and even we have .items for the dictionary -->
8
-
<li><ahref="{{ url_for('post', post_id=post_id) }}">{{ post['title'] }}</a></li> <!-- Here we use url_for to take us to the appropriate route. -->
0 commit comments