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.
pip install sphinx-faviconVerified import paths — ran on the pinned version, not inferred.
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.
Update your `conf.py` file: change `extensions = ['sphinx-favicon']` to `extensions = ['sphinx_favicon']`.
Ensure `html_static_path = ['_static']` (or your chosen static directory) is set in your `conf.py` file, and your favicon images are within that directory.
If using `sphinx-favicon`, rely on the `favicons` list for all your favicon definitions for best results. Avoid setting `html_favicon` in `conf.py` if `favicons` provides the desired functionality.