diff --git a/docs/user_guide/keyboard-shortcuts.md b/docs/user_guide/keyboard-shortcuts.md index c163d47d40..42bfeb93e8 100644 --- a/docs/user_guide/keyboard-shortcuts.md +++ b/docs/user_guide/keyboard-shortcuts.md @@ -3,18 +3,3 @@ ## Trigger the search bar You can trigger the search bar pop-up with {kbd}`Ctrl`/{kbd}`⌘` + {kbd}`K`. - -## Change pages - -By default, you can move to the previous/next page using the {octicon}`arrow-left` (left arrow) and {octicon}`arrow-right` (right arrow) keys on a keyboard. -To disable this behavior, use the following configuration: - -```py -html_theme_options = { - "navigation_with_keys": False -} -``` - -```{attention} -Keep in mind that many readers use their keyboards and other assistive technology to interact with web documents. If you disable the keyboard navigation, you might be making your documentaion inaccessible to many readers. -``` diff --git a/src/pydata_sphinx_theme/__init__.py b/src/pydata_sphinx_theme/__init__.py index b1b87afefc..1e201441d1 100644 --- a/src/pydata_sphinx_theme/__init__.py +++ b/src/pydata_sphinx_theme/__init__.py @@ -50,6 +50,18 @@ def update_config(app): "Use the sphinx-favicon extension instead." ) + # TODO: in 0.15, set the default navigation_with_keys value to False and remove this deprecation notice + if theme_options.get("navigation_with_keys", None) is None: + logger.warning( + "The default value for `navigation_with_keys` will change to `False` in " + "the next release. If you wish to preserve the old behavior for your site, " + "set `navigation_with_keys=True` in the `html_theme_options` dict in your " + "`conf.py` file." + "Be aware that `navigation_with_keys = True` has negative accessibility implications:" + "https://github.com/pydata/pydata-sphinx-theme/issues/1492" + ) + theme_options["navigation_with_keys"] = False + # Validate icon links if not isinstance(theme_options.get("icon_links", []), list): raise ExtensionError( diff --git a/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/theme.conf b/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/theme.conf index 3124424fd1..de4b5ddc1f 100644 --- a/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/theme.conf +++ b/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/theme.conf @@ -23,7 +23,7 @@ favicons = show_prev_next = True search_bar_text = Search the docs ... search_bar_position = sidebar -navigation_with_keys = True +navigation_with_keys = collapse_navigation = False navigation_depth = 4 show_nav_level = 1