Created
March 16, 2012 17:07
-
-
Save colinta/2051179 to your computer and use it in GitHub Desktop.
I wish jinja2 could extend blocks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<title>{{ title or "My Title" }}</title> | |
<body> | |
{% block headers %}{% endblock %} | |
{% block content %}{% endblock %} | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block headers %} | |
<h1>{% block headers %}{% end block %}</h1> | |
{% end block %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<title>BAH</title> | |
<body> | |
<h1>Hi!</h1> | |
<p>my content</p> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "headers.html" %} | |
{% set title="BAH" %} | |
{% block headers %} | |
Hi! | |
{% endblock %} | |
{% block content %} | |
<p>my content</p> | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment