Sphinx Favicon

1.1.0 · active · verified Thu Apr 16

Sphinx Favicon is an active Sphinx extension, currently at version 1.1.0, that enhances the ability to add custom favicons to Sphinx HTML documentation. It allows users to define favicons directly in `conf.py` with various attributes like `rel`, `sizes`, `href`, or `name`, providing more flexibility than Sphinx's default `favicon.ico` support. The library maintains a steady release cadence with recent updates focusing on bug fixes and dependency modernization.

Common errors

Warnings

Install

Imports

Quickstart

To quickly integrate `sphinx-favicon` into your Sphinx project, first ensure your favicon images (e.g., `icon.png`, `apple-touch-icon.png`) are placed in your `_static` directory. Then, modify your `conf.py` file to include `sphinx_favicon` in your `extensions` list and configure the `favicons` list with paths to your images. The `html_static_path` must be defined if using relative paths for favicons.

# conf.py

# Add the extension to the list of enabled Sphinx extensions
extensions = [
    'sphinx.ext.autodoc',
    'sphinx_favicon',
]

# Configure the directory for static files (where your favicon images will be)
html_static_path = ['_static']

# Define your favicons. Ensure 'icon.png' exists in your _static directory.
favicons = [
    {"href": "icon.png"},
    {"rel": "apple-touch-icon", "href": "apple-touch-icon.png"}
]

view raw JSON →