Skip to content

Commit 3ba8977

Browse files
12rambaucholdgraf
andauthored
fix: deprecate use of the favicon config parameter (#1225)
Co-authored-by: Chris Holdgraf <[email protected]>
1 parent 26a261d commit 3ba8977

File tree

14 files changed

+106
-74
lines changed

14 files changed

+106
-74
lines changed
14.5 KB
Loading
48 KB
Loading

docs/_static/apple-touch-icon.png

9.79 KB
Loading

docs/_static/favicon-16x16.png

1.24 KB
Loading

docs/_static/favicon-32x32.png

2.18 KB
Loading

docs/_static/favicon.ico

14.7 KB
Binary file not shown.

docs/_static/mstile-150x150.png

2.86 KB
Loading

docs/_static/safari-pinned-tab.svg

Lines changed: 23 additions & 0 deletions
Loading

docs/conf.py

Lines changed: 51 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -- Path setup --------------------------------------------------------------
22
import os
33
import sys
4+
import pydata_sphinx_theme
45

56
sys.path.append("scripts")
67
from gallery_directive import GalleryDirective
@@ -11,9 +12,6 @@
1112
copyright = "2019, PyData Community"
1213
author = "PyData Community"
1314

14-
import pydata_sphinx_theme
15-
16-
1715
# -- General configuration ---------------------------------------------------
1816

1917
extensions = [
@@ -33,41 +31,55 @@
3331
# "nbsphinx", # Uncomment and comment-out MyST-NB for local testing purposes.
3432
"numpydoc",
3533
"sphinx_togglebutton",
34+
"sphinx_favicon",
3635
]
3736

38-
# -- Internationalization ------------------------------------------------
39-
# specifying the natural language populates some key tags
40-
language = "en"
37+
# Add any paths that contain templates here, relative to this directory.
38+
templates_path = ["_templates"]
39+
40+
# List of patterns, relative to source directory, that match files and
41+
# directories to ignore when looking for source files.
42+
# This pattern also affects html_static_path and html_extra_path.
43+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"]
44+
45+
# -- Sitemap -----------------------------------------------------------------
4146

4247
# ReadTheDocs has its own way of generating sitemaps, etc.
4348
if not os.environ.get("READTHEDOCS"):
4449
extensions += ["sphinx_sitemap"]
4550

46-
# -- Sitemap -------------------------------------------------------------
4751
html_baseurl = os.environ.get("SITEMAP_URL_BASE", "http://127.0.0.1:8000/")
4852
sitemap_locales = [None]
4953
sitemap_url_scheme = "{link}"
5054

55+
56+
# -- autosummary -------------------------------------------------------------
57+
5158
autosummary_generate = True
5259

53-
# Add any paths that contain templates here, relative to this directory.
54-
templates_path = ["_templates"]
5560

56-
# List of patterns, relative to source directory, that match files and
57-
# directories to ignore when looking for source files.
58-
# This pattern also affects html_static_path and html_extra_path.
59-
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"]
61+
# -- Internationalization ----------------------------------------------------
6062

61-
# -- Extension options -------------------------------------------------------
63+
# specifying the natural language populates some key tags
64+
language = "en"
65+
66+
# -- MyST options ------------------------------------------------------------
6267

6368
# This allows us to use ::: to denote directives, useful for admonitions
6469
myst_enable_extensions = ["colon_fence", "linkify", "substitution"]
70+
myst_heading_anchors = 2
71+
myst_substitutions = {"rtd": "[Read the Docs](https://readthedocs.org/)"}
72+
73+
# -- Ablog options -----------------------------------------------------------
74+
75+
blog_path = "examples/blog/index"
76+
blog_authors = {
77+
"pydata": ("PyData", "https://pydata.org"),
78+
"jupyter": ("Jupyter", "https://jupyter.org"),
79+
}
6580

6681
# -- Options for HTML output -------------------------------------------------
6782

68-
# The theme to use for HTML and HTML Help pages. See the documentation for
69-
# a list of builtin themes.
70-
#
7183
html_theme = "pydata_sphinx_theme"
7284
html_logo = "_static/logo.svg"
7385
html_favicon = "_static/logo.svg"
@@ -168,9 +180,6 @@
168180
],
169181
}
170182

171-
myst_heading_anchors = 2
172-
myst_substitutions = {"rtd": "[Read the Docs](https://readthedocs.org/)"}
173-
174183
html_context = {
175184
"github_user": "pydata",
176185
"github_repo": "pydata-sphinx-theme",
@@ -182,22 +191,35 @@
182191
"contributing.rst": "community/index.rst",
183192
}
184193

185-
# ABlog configuration
186-
blog_path = "examples/blog/index"
187-
blog_authors = {
188-
"pydata": ("PyData", "https://pydata.org"),
189-
"jupyter": ("Jupyter", "https://jupyter.org"),
190-
}
191-
192-
193194
# Add any paths that contain custom static files (such as style sheets) here,
194195
# relative to this directory. They are copied after the builtin static files,
195196
# so a file named "default.css" will overwrite the builtin "default.css".
196197
html_static_path = ["_static"]
197198
html_css_files = ["custom.css"]
198199
todo_include_todos = True
199200

201+
# -- favicon options ---------------------------------------------------------
202+
203+
# see https://sphinx-favicon.readthedocs.io for more information about the
204+
# sphinx-favicon extention
205+
favicons = [
206+
# generic icons compatible with most browsers
207+
"favicon-32x32.png",
208+
"favicon-16x16.png",
209+
{"rel": "shortcut icon", "sizes": "any", "href": "favicon.ico"},
210+
# chrome specific
211+
"android-chrome-192x192.png",
212+
# apple icons
213+
{"rel": "mask-icon", "color": "#459db9", "href": "safari-pinned-tab.svg"},
214+
{"rel": "apple-touch-icon", "href": "apple-touch-icon.png"},
215+
# msapplications
216+
{"name": "msapplication-TileColor", "content": "#459db9"},
217+
{"name": "theme-color", "content": "#ffffff"},
218+
{"name": "msapplication-TileImage", "content": "mstile-150x150.png"},
219+
]
220+
221+
# -- application setup -------------------------------------------------------
222+
200223

201224
def setup(app):
202-
# Add the gallery directive
203225
app.add_directive("gallery-grid", GalleryDirective)

docs/user_guide/branding.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ This will appear just after your logo image if it is set.
113113
Add favicons
114114
============
115115

116+
.. deprecated:: 0.15
117+
118+
Support for complex and multiple favicons will be dropped in version 0.15. Instead use the `sphinx-favicon <https://sphinx-favicon.readthedocs.io/en/stable/>`__ extension. It provides the same functionality using more flexible parameters.
119+
120+
116121
``pydata_sphinx_theme`` supports the `standard sphinx favicon configuration <https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_favicon>`_, using ``html_favicon``.
117122

118123
Additionally you may add any number of browser- or device-specific favicons of any size.

0 commit comments

Comments
 (0)