From c61f91f357849df5f0ce746ef5146a3c8e2784bd Mon Sep 17 00:00:00 2001
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 83b0820606..42d8f3b829 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 %}
-- 
2.30.2

