From: Benjamin Drung <benjamin.drung@ionos.com>
Date: Wed, 13 Oct 2021 20:04:48 +0200
Subject: Support sphinx 4.2

Add the sphinx documentation options provided by sphinx 4.2. Otherwise
the search will produce URLs with `undefined` instead of `.html`:

```
ref/states/all/salt.states.fileundefined?highlight=file#module-salt.states.file
```

Forwarded: https://github.com/saltstack/salt/pull/61047
Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
---
 doc/_themes/saltstack/layout.html | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/doc/_themes/saltstack/layout.html b/doc/_themes/saltstack/layout.html
index 502b5f5..8b2426c 100644
--- a/doc/_themes/saltstack/layout.html
+++ b/doc/_themes/saltstack/layout.html
@@ -75,9 +75,14 @@
         var DOCUMENTATION_OPTIONS = {
             URL_ROOT:    '{{ url_root }}',
             VERSION:     '{{ release|e }}',
+            LANGUAGE: '{{ language }}',
             COLLAPSE_INDEX: false,
+            BUILDER: '{{ builder }}',
             FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
-            HAS_SOURCE:  {{ has_source|lower }}
+            LINK_SUFFIX: '{{ link_suffix }}',
+            HAS_SOURCE: {{ has_source|lower }},
+            SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}',
+            NAVIGATION_WITH_KEYS: {{ 'true' if theme_navigation_with_keys|tobool else 'false'}}
         };
     </script>
     {%- for scriptfile in script_files %}
