Skip to content

Commit 572091f

Browse files
author
Chad Norvell
committed
Add block to allow inserting content before main
When extending Furo using a template with `extends`, there's currently not a way to add content within the `page` but before or after `main`. An example would be a top navigation bar that sits above the rest of the content but not over the left-side navigation bar. This change adds a block that allows this through a template like this: ``` {% extends "furo/page.html" %} {% block supermain %} <div class="my-custom-content"> <h1>Hello World</h1> </div> {{ super() }} <div class="my-custom-content-on-the-bottom"> <h1>Goodbye World</h1> </div> {% endblock supermain %} ``` If you don't use templates to extend Furo, or if your templates don't define the `supermain` block, this change has no effect.
1 parent e7f732e commit 572091f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/furo/theme/furo/page.html

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
{% endblock left_sidebar %}
5959
</div>
6060
</aside>
61+
{% block supermain %}
6162
<div class="main">
6263
<div class="content">
6364
<div class="article-container">
@@ -205,5 +206,6 @@
205206
{% endblock right_sidebar %}
206207
</aside>
207208
</div>
209+
{% endblock supermain %}
208210
</div>
209211
{%- endblock %}

0 commit comments

Comments
 (0)