Skip to content

Commit 201d420

Browse files
committed
When injecting the mike MkDocs plugin, ensure the search plugin is listed by default; resolves #58
1 parent 290d390 commit 201d420

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Bug fixes
66

77
- When redirecting to another page, include the `#hash`
8+
- Ensure the MkDocs `search` plugin is correctly enabled when building via mike
89

910
## v1.0.0 (2021-04-10)
1011

mike/mkdocs_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def inject_plugin(config_file):
2424
with open(config_file) as f:
2525
config = yaml.load(f, Loader=yaml.Loader)
2626

27-
plugins = config.setdefault('plugins', [])
27+
plugins = config.setdefault('plugins', ['search'])
2828
for i in plugins:
2929
if ( (isinstance(i, str) and i == 'mike') or
3030
(isinstance(i, dict) and 'mike' in i) ):

test/unit/test_mkdocs_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_no_plugins(self):
7171
newcfg = yaml.load(out.getvalue(), Loader=yaml.Loader)
7272
mremove.assert_called_once()
7373

74-
self.assertEqual(newcfg, {'plugins': ['mike']})
74+
self.assertEqual(newcfg, {'plugins': ['mike', 'search']})
7575

7676
def test_other_plugins(self):
7777
out = self.Stream()

0 commit comments

Comments
 (0)