Skip to content

Instantly share code, notes, and snippets.

@rtuita23
Created February 16, 2015 04:37
Show Gist options
  • Save rtuita23/bef8ab08e8087f538a05 to your computer and use it in GitHub Desktop.
Save rtuita23/bef8ab08e8087f538a05 to your computer and use it in GitHub Desktop.
base.html
{% from "macros.html" import nav_link with context %}
<!DOCTYPE html>
<html>
<head>
<title>Flask Template Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
div#main {
max-width: 500px;
padding: 20px;
}
nav .title {
font-weight: bold;
}
a.active {
font-weight: bold;
}
</style>
</head>
<body>
<ul class="nav navbar-nav">
{{ nav_link('home', 'Home') }}
{{ nav_link('about', 'About') }}
{{ nav_link('contact', 'Contact Us') }}
</ul>
<div id="main">
<h2>This is part of my base template</h2>
<br>
{% block content %}{% endblock %}
<br>
<h2>This is part of my base template</h2>
</div>
</body>
<footer>
{% block footer %}
Watch! This part of the footer is coming from the base template....
<br>
<br>
{% endblock %}
</footer>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment