mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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:
parent
4878fc82a7
commit
d813c5148e
1 changed files with 36 additions and 28 deletions
8
pelican/themes/simple/templates/base.html
vendored
8
pelican/themes/simple/templates/base.html
vendored
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue