Skip to content
Myr

Merge pull request #395 from esonderegger/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Updated template documentation examples

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parents e5de47f, b8230a7 · Browse files · 1 file+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:docs/templates.rst+3 added-3 removed
23 unmodified lines
2425Below is a minimal template that illustrates a few basics using the default26Jinja configuration. We will cover the details later in this document::2728 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">28 <!DOCTYPE html>29 <html lang="en">30 <head>31 <title>My Webpage</title>32 </head>
309 unmodified lines
342This template, which we'll call ``base.html``, defines a simple HTML skeleton343document that you might use for a simple two-column page. It's the job of344"child" templates to fill the empty blocks with content::345346 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">346 <!DOCTYPE html>347 <html lang="en">348 <html xmlns="http://www.w3.org/1999/xhtml">348 <head>349 {% block head %}350 <link rel="stylesheet" href="style.css" />351 <title>{% block title %}{% endblock %} - My Webpage</title>
6 unmodified lines
358 &copy; Copyright 2008 by <a href="http://domain.invalid/">you</a>.359 {% endblock %}360 </div>361 </body>362 </html>363364In this example, the ``{% block %}`` tags define four blocks that child templates365can fill in. All the `block` tag does is tell the template engine that a366child template may override those placeholders in the template.
1143 unmodified lines