Add configurable keyboard shortcut to focus search input (#1411)

Adds a keyboard shortcut to use Ctrl/Cmd and a configurable key to focus the search input. The key is configurable with `search.focus_shortcut_key`; enables it on the core docs site with `'k'` (default on many sites).

---------
Co-authored-by: Matt Wang <mxw@cs.washington.edu>
This commit is contained in:
Roman KC
2024-02-22 02:28:45 +05:45
committed by GitHub
parent 52b4b444d0
commit 01719a8752
5 changed files with 35 additions and 1 deletions

View File

@@ -78,6 +78,8 @@ search:
# Enable or disable the search button that appears in the bottom right corner of every page
# Supports true or false (default)
button: false
# Focus the search input by pressing `ctrl + focus_shortcut_key` (or `cmd + focus_shortcut_key` on macOS)
focus_shortcut_key: 'k'
# For copy button on code
enable_copy_code_button: true