Skip to docs navigation Skip to main content
Nefertiti-for-Sphinx Nefertiti for Sphinx
Search the documentation

Nefertiti for Sphinx

  • danirus/sphinx-nefertiti

  • Nefertiti for Sphinx v: 0.3.7
    • Versions
    • latest
    • stable
    • 0.3.7
    • 0.3.6
    • 0.3.5
    • 0.3.4
    • 0.3.3
    • 0.3.2
    • 0.2.3
    • 0.1.13

    • On Read the Docs
    • Project Home
    • Builds

  • Change color set
    • Change color set
    • Blue
    • Indigo
    • Purple
    • Pink
    • Red
    • Orange
    • Yellow
    • Green
    • Teal
    • Cyan

  • Toggle light/dark
    • Light/dark
    • Light
    • Dark
    • Default
  Index
Table of contents
  • Quick start
  • User’s guide
    • Installation
    • Customization
      • Fonts
      • Color sets
      • Pygments
      • Git repository
      • Version dropdown
      • Footer links
    • Components
      • Admonitions
      • Version changes
      • Code blocks
      • Headings
      • Images
      • Figures
      • Lists
      • Tables
        • Tables in Markdown
        • Tables in reStructuredText
      • Math and equations
        • Math in Markdown
        • Math in reStructuredText
      • Footnotes
    • Accessibility
    • Development
    • Contributing

Footer links¶

The footer of HTML pages built with Nefertiti for Sphinx is divided in 4 areas or strings, from top to bottom:

  • The area for the Nefertiti footer links.

  • The name of the project, provided by Sphinx project setting.

  • The copyright notice, provided by Sphinx copyright setting.

  • The powered by notice.

The first and the last are theme specific and therefore they are represented by options within the html_theme_options setting.

Theme options¶

The following two options can be customized in the html_theme_options, in your project’s conf.py file:

  1. footer_links: Represents a list of strings and links.

  2. show_powered_by: A boolean value.

1. footer_links¶

The footer links can be used to lead the user to other relevant pages related with your project, like a project’s homepage, a code repository, a forum or similar.

The content for the footer_links is a comma separated list of links with the format <label>|<url>. Each link has a <label>, which represents the text for the link, and a <url>, which is the URL the user will visit when clicking on the link.

A valid footer links could be:

html_theme_options = {
    # ... other options ...
    "footer_links": "Home|/,Documentation|/docs,Code|/code"
}

If the list of links is longer you can separate the links in multiple lines. Here is an example of a multi line string in Python nested within parenthesys for clarity:

html_theme_options = {
    # ... other options ...
    "footer_links": (
        "Home|https://myproject.org,"
        "Documentation|https://myproject.org/docs,"
        "Code|https://myproject.org/code"
    )
}

Be aware that the last character in each string is the comma: ,.

You could also use Python’s String join method, and provide one link per line, like this:

html_theme_options = {
    # ... other options ...
    "footer_links": ",".join([
        "Home|/",
        "Documentation|/docs",
        "Code|/code"
    ])
}

In this case, the comma separates each string within the list delimited by [].

As an example, the footer links available at the bottom of this documentation have been provided as a Python list and joined with a comma, like this:

html_theme_options = {
    # ... other options ...
    "footer_links": ",".join([
        "Documentation|https://sphinx-nefertiti.readthedocs.com",
        "Package|https://pypi.com/sphinx-nefertiti",
        "Repository|https://github.com/danirus/sphinx-nefertiti",
        "Issues|https://github.com/danirus/sphinx-nefertiti/issues",
    ])
}

2. show_powered_by¶

The powered by notice is a static string with the value Built with Sphinx and Nefertiti. It is displayed by default, and can be omitted by setting the show_powered_by to False in the html_theme_options:

html_theme_options = {
    # ... other options ...
    "show_powered_by": False
}

Rebuild the theme¶

With all the previous changes in place, save the content, clean up the build directory, build it and serve it again:

$ make clean
$ make html
$ python -m http.server -d build/html

Visit http://localhost:8000 to take a look at the changes.

  On this page
  • Footer links
    • Theme options
      • 1. footer_links
      • 2. show_powered_by
    • Rebuild the theme
  • Previous Version dropdown
  • Next Components
  • Documentation
  • Package
  • Repository
  • Issues
Nefertiti for Sphinx
  • Code licensed MIT, docs CC BY 3.0.
Built with Sphinx 7.4.7 and Nefertiti 0.3.6