`` within the left sidebar that appears at the
bottom of the page, regardless of the content that is above it.
To control the HTML templates that are within this div, use
``html_theme_options['left_sidebar_end']`` in ``conf.py``.
By default, it has the following templates:
.. code-block:: python
html_theme_options = {
...
"left_sidebar_end": ["sidebar-ethical-ads"],
...
}
Remove the primary sidebar from pages
-------------------------------------
If you'd like the left sidebar to be removed from a page, you can use the
following configuration in ``conf.py``:
.. code-block:: python
html_sidebars = {
"pagename": []
}
This works for glob-style patterns as well. For example:
.. code-block:: python
html_sidebars = {
"folder/*": []
}
If you'd like to remove the left sidebar from **all** pages of your documentation,
use this pattern:
.. code-block:: python
html_sidebars = {
"**": []
}
.. _layout-sidebar-secondary:
Secondary Sidebar (right)
=========================
The in-page sidebar is just to the right of a page's main content, and is
configured in ``conf.py`` with ``html_theme_options['page_sidebar_items']``.
By default, it has the following templates:
.. code-block:: python
html_theme_options = {
...
"page_sidebar_items": ["page-toc", "edit-this-page", "sourcelink"],
...
}
.. _layout-article-footer:
Article Footer
==============
The article footer exists just below your page's article, and is primarily used for navigating between adjacent sections / pages.
Hide the previous and next buttons
----------------------------------
By default, each page of your site will have "previous" and "next" buttons
at the bottom. You can hide these buttons with the following configuration:
.. code:: python
html_theme_options = {
"show_prev_next": False
}
.. _layout-footer:
Footer
======
The footer is just below a page's main content, and is configured in ``conf.py``
with ``html_theme_options['footer_items']``.
By default, it has the following templates:
.. code-block:: python
html_theme_options = {
...
"footer_items": ["copyright", "sphinx-version"],
...
}
Change footer display
---------------------
Each footer element is wrapped in a ``
`` with a ``footer-item`` class, allowing you to style the structure of these items with custom CSS.
For example, by default the footer items are displayed as blocks that stack vertically.
To change this behavior so that they stack **horizontally**, add a rule like the following in your custom ``.css`` file.
.. code-block:: css
/* Make each footer item in-line so they stack horizontally instead of vertically */
.footer-item {
display: inline-block;
}
/* Add a separating border line for all but the last item */
.footer-item:not(:last-child) {
border-right: 1px solid var(--pst-color-text-base);
margin-right: .5em;
padding-right: .5em;
}
Built-in components to insert into sections
===========================================
Below is a list of built-in templates that you can insert into any section.
Note that some of them may have CSS rules that assume a specific section (and
will be named accordingly).
.. refer to files in: src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/
- ``copyright.html``
- ``edit-this-page.html``
- ``footer-article/prev-next.html``
- ``icon-links.html``
- ``last-updated.html``
- ``navbar-icon-links.html``
- ``navbar-logo.html``
- ``navbar-nav.html``
- ``page-toc.html``
- ``search-button.html``
- ``search-field.html``
- ``sidebar-ethical-ads.html``
- ``sidebar-nav-bs.html``
- ``sourcelink.html``
- ``sphinx-version.html``
- ``theme-switcher.html``
- ``version-switcher.html``
Add your own HTML templates to theme sections
=============================================
If you'd like to add your own custom template to any of these sections, you
could do so with the following steps:
1. Create an HTML file in a folder called ``_templates``. For example, if
you wanted to display the version of your documentation using a Jinja
template, you could create a file: ``_templates/version.html`` and put the
following in it:
.. code-block:: html
{{ version }}
2. Now add the file to your menu items for one of the sections above. For example:
.. code-block:: python
html_theme_options = {
...
"navbar_start": ["navbar-logo", "version"],
...
}