Add more blocks to simple base template

This change makes it easier to create new themes by inheriting from the
simple theme. It allows customization of the whole body (while still
making use of the theme’s head), or individual parts of the body like
header, menu, or footer.
This commit is contained in:
Frederik Elwert 2024-10-10 14:10:12 +02:00
commit d813c5148e

View file

@ -40,8 +40,12 @@
</head> </head>
<body> <body>
{% block body %}
<header> <header>
{% block header %}
<hgroup><h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a></h1>{% if SITESUBTITLE %}<p>{{ SITESUBTITLE }}</p>{% endif %}</hgroup> <hgroup><h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a></h1>{% if SITESUBTITLE %}<p>{{ SITESUBTITLE }}</p>{% endif %}</hgroup>
{% endblock %}
{% block nav %}
<nav><ul> <nav><ul>
{% for title, link in MENUITEMS %} {% for title, link in MENUITEMS %}
<li><a href="{{ link }}">{{ title }}</a></li> <li><a href="{{ link }}">{{ title }}</a></li>
@ -57,16 +61,20 @@
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</ul></nav> </ul></nav>
{% endblock %}
</header> </header>
<main> <main>
{% block content %} {% block content %}
{% endblock %} {% endblock %}
</main> </main>
<footer> <footer>
{% block footer %}
<address> <address>
Proudly powered by <a rel="nofollow" href="https://getpelican.com/">Pelican</a>, Proudly powered by <a rel="nofollow" href="https://getpelican.com/">Pelican</a>,
which takes great advantage of <a rel="nofollow" href="https://www.python.org/">Python</a>. which takes great advantage of <a rel="nofollow" href="https://www.python.org/">Python</a>.
</address> </address>
{% endblock %}
</footer> </footer>
{% endblock %}
</body> </body>
</html> </html>