Skip to content

Commit 15f9b52

Browse files
committed
Mode page title to content block
1 parent 6be3642 commit 15f9b52

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

hello_app/templates/about.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{% extends "layout.html" %}
2+
{% block title %}
3+
About us
4+
{% endblock %}
25
{% block content %}
3-
<p>About page for the Flask tutorial.</p>
6+
<p>About page for the Visual Studio Code Flask tutorial.</p>
47
{% endblock %}

hello_app/templates/contact.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{% extends "layout.html" %}
2+
{% block title %}
3+
Contact us
4+
{% endblock %}
25
{% block content %}
3-
<p>Contact page for the Flask tutorial.</p>
6+
<p>Contact page for the VIsual Studio Code Flask tutorial.</p>
47
{% endblock %}

hello_app/templates/home.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{% extends "layout.html" %}
2+
{% block title %}
3+
Home
4+
{% endblock %}
25
{% block content %}
3-
<p>Home page for the Flask tutorial.</p>
6+
<p>Home page for the Visual Studio Code Flask tutorial.</p>
47
{% endblock %}

hello_app/templates/layout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
<title>{{ title }}</title>
5+
<title>{% block title %}{% endblock %}</title>
66
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='site.css') }}" />
77
</head>
88

hello_app/views.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
@app.route('/')
66
def home():
7-
return render_template("home.html", title="Home")
7+
return render_template("home.html")
88

99
@app.route('/about')
1010
def about():
11-
return render_template("about.html", title="About us")
11+
return render_template("about.html")
1212

1313
@app.route('/contact')
1414
def contact():
15-
return render_template("contact.html", title="Contact us")
15+
return render_template("contact.html")
1616

1717
@app.route('/hello/<name>')
1818
def hello_there(name):

0 commit comments

Comments
 (0)