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
64
pelican/themes/simple/templates/base.html
vendored
64
pelican/themes/simple/templates/base.html
vendored
|
|
@ -40,33 +40,41 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<header>
|
{% block body %}
|
||||||
<hgroup><h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a></h1>{% if SITESUBTITLE %}<p>{{ SITESUBTITLE }}</p>{% endif %}</hgroup>
|
<header>
|
||||||
<nav><ul>
|
{% block header %}
|
||||||
{% for title, link in MENUITEMS %}
|
<hgroup><h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a></h1>{% if SITESUBTITLE %}<p>{{ SITESUBTITLE }}</p>{% endif %}</hgroup>
|
||||||
<li><a href="{{ link }}">{{ title }}</a></li>
|
{% endblock %}
|
||||||
{% endfor %}
|
{% block nav %}
|
||||||
{% if DISPLAY_PAGES_ON_MENU %}
|
<nav><ul>
|
||||||
{% for p in pages %}
|
{% for title, link in MENUITEMS %}
|
||||||
<li><a href="{{ SITEURL }}/{{ p.url }}" {% if p==page %} aria-current="page" {% endif %}>{{ p.title }}</a></li>
|
<li><a href="{{ link }}">{{ title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% if DISPLAY_PAGES_ON_MENU %}
|
||||||
{% if DISPLAY_CATEGORIES_ON_MENU %}
|
{% for p in pages %}
|
||||||
{% for cat, null in categories %}
|
<li><a href="{{ SITEURL }}/{{ p.url }}" {% if p==page %} aria-current="page" {% endif %}>{{ p.title }}</a></li>
|
||||||
<li><a href="{{ SITEURL }}/{{ cat.url }}" {% if cat==category %} aria-current="page" {% endif %}>{{ cat}}</a></li>
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endif %}
|
||||||
{% endif %}
|
{% if DISPLAY_CATEGORIES_ON_MENU %}
|
||||||
</ul></nav>
|
{% for cat, null in categories %}
|
||||||
</header>
|
<li><a href="{{ SITEURL }}/{{ cat.url }}" {% if cat==category %} aria-current="page" {% endif %}>{{ cat}}</a></li>
|
||||||
<main>
|
{% endfor %}
|
||||||
{% block content %}
|
{% endif %}
|
||||||
{% endblock %}
|
</ul></nav>
|
||||||
</main>
|
{% endblock %}
|
||||||
<footer>
|
</header>
|
||||||
<address>
|
<main>
|
||||||
Proudly powered by <a rel="nofollow" href="https://getpelican.com/">Pelican</a>,
|
{% block content %}
|
||||||
which takes great advantage of <a rel="nofollow" href="https://www.python.org/">Python</a>.
|
{% endblock %}
|
||||||
</address>
|
</main>
|
||||||
</footer>
|
<footer>
|
||||||
|
{% block footer %}
|
||||||
|
<address>
|
||||||
|
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>.
|
||||||
|
</address>
|
||||||
|
{% endblock %}
|
||||||
|
</footer>
|
||||||
|
{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue