Skip to content
Myr

Updated template documentation examples

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

Fixed html tags in base template example. Since I was removing the xmlns="http://www.w3.org/1999/xhtml" tag, it seemed like a good time to update the examples to the html5 doctype.

authored by Evan Sonderegger · committed by Evan Sonderegger · parent 85820fc · 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
22 unmodified lines
2324Below is a minimal template that illustrates a few basics. We will cover25the details later in that document::2627 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">27 <!DOCTYPE html>28 <html lang="en">29 <head>30 <title>My Webpage</title>31 </head>
289 unmodified lines
321This template, which we'll call ``base.html``, defines a simple HTML skeleton322document that you might use for a simple two-column page. It's the job of323"child" templates to fill the empty blocks with content::324325 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">325 <!DOCTYPE html>326 <html lang="en">327 <html xmlns="http://www.w3.org/1999/xhtml">327 <head>328 {% block head %}329 <link rel="stylesheet" href="style.css" />330 <title>{% block title %}{% endblock %} - My Webpage</title>
6 unmodified lines
337 &copy; Copyright 2008 by <a href="http://domain.invalid/">you</a>.338 {% endblock %}339 </div>340 </body>341 </html>342343In this example, the ``{% block %}`` tags define four blocks that child templates344can fill in. All the `block` tag does is to tell the template engine that a345child template may override those portions of the template.
1111 unmodified lines