sphinx-favicon¶
- Homepage:
- Documentation:
With sphinx-favicon
, you can add custom favicons to your Sphinx html
documentation quickly and easily.
You can define favicons directly in conf.py
, with different rel
attributes such as icon
or apple-touch-icon
and any favicon size.
The sphinx-favicon
extension gives you more flexibility than the standard
favicon.ico supported by Sphinx.
It provides a quick and easy way to add the most important favicon formats for
different browsers and devices.
Example¶
HTML code generated with sphinx-favicon
:
<link rel="icon" href="https://secure.example.com/favicon/favicon-16x16.png" sizes="16x16" type="image/png">
<link rel="icon" href="https://secure.example.com/favicon/favicon-32x32.png" sizes="32x32" type="image/png">
<link rel="apple-touch-icon" href="https://secure.example.com/favicon/apple-touch-icon-180x180.png" sizes="180x180" type="image/png">
Installation¶
pip install sphinx-favicon
Configuration¶
# conf.py
extensions = [
'...',
'sphinx_favicon',
]
favicons = [
{
"sizes": "16x16",
"href": "https://secure.example.com/favicon/favicon-16x16.png",
},
{
"sizes": "32x32",
"href": "https://secure.example.com/favicon/favicon-32x32.png",
},
{
"rel": "apple-touch-icon",
"sizes": "180x180",
"href": "apple-touch-icon-180x180.png", # use a local file in _static
},
]
See the project documentation for more configuration options!