Skip to content
This repository was archived by the owner on Sep 13, 2022. It is now read-only.

Making a new base template

Nicholas Pringle edited this page May 6, 2013 · 1 revision

What does a base template need?

Set the DOCTYPE to ensure proper rendering.
You may need to import macros...
Open the html tags...

<!DOCTYPE html>
import macros
<html>
  Everything in here...
</html>

Inside the <html> tags there are two 'direct descendents': <head> and <body>.
Inside the <head> tags we put links to the css stylesheets and the JavaScript libraries as well as the page title and meta data.
Inside the <title> tags you need to a # block title and a {{ title }} variable as this will change for each page...

<head>
  <title>
    {% block title %}
      {{ title }}
    {% endblock title %}
  <title>
  <meta></meta>
  <link></link>
  <script></script>
</head>

Inside the <body> tags you can put your <header>, <main>, and <footer> tags.

<body>
  <header>
    <h1></h1>
    <nav></nav>
  </header>
  <main>
    <article>
      <h1></h1>
      <p></p>
    </article>
    <section>
    </section>
  </main>
  <footer>
  </footer>
</body>

Clone this wiki locally