pradyunsg / furo

A clean customizable documentation theme for Sphinx
https://pradyunsg.me/furo/quickstart
MIT License
2.65k stars 304 forks source link

Add block to allow inserting content before `main` #655

Open chadnorvell opened 1 year ago

chadnorvell commented 1 year ago

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.

chadnorvell commented 1 year ago

@Eric-Arellano Our use case is similar, but we actually want to insert a nav bar above the content block, but not above the left table of contents. You can see what that looks like here. This method is how we insert that nav bar, but it relies on this PR's change, as utilized here.

@pradyunsg What can I do to help get this merged?

AnthonyDiGirolamo commented 11 months ago

hello Furo team! Anything we can do to help make this better?