Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add block to allow inserting content before main #655

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on May 4, 2023

  1. 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.
    Chad Norvell committed May 4, 2023
    Configuration menu
    Copy the full SHA
    572091f View commit details
    Browse the repository at this point in the history