使用基本模板

base.twig.html

<!DOCTYPE html>
<html>
    <head>
        <title>{{ title | default('Hello World') }}</title>
        <link rel="stylesheet" type="text/css" href="theme.css">
        {% block css %}
        {% endblock %}
    </head>
    <body>
    {% block body %}
        <nav>
        {% block navigation %}
            <a href="#">Link</a>
            <a href="#">Link</a>
            <a href="#">Link</a>
        {% endblock navigation %}
        </nav>
        <section id="container">
            <section id="content">
            {% block content %}
            <p>
            Lorem ipsum dolor sit amet.
            </p>
        </section>
        {% endblock content %}
    </section>
    {% endblock body %}
    </body>
</html>

page.twig.html

{% extends base.twig.html %}
{% block navigation %}
<a href="page2.html">Page 2</a>
<a href="page3.html">Page 3</a>
<a href="page4.html">Page 4</a>
{% endblock %}
{% block content %}
This is my first page
{% endblock content %}