Skip to content

Commit de460c8

Browse files
committed
Implement mkdocs key
1 parent 1673b29 commit de460c8

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

readthedocs/doc_builder/backends/mkdocs.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ def __init__(self, *args, **kwargs):
6161

6262
def get_yaml_config(self):
6363
"""Find the ``mkdocs.yml`` file in the project root."""
64-
# TODO: try to load from the configuration file first.
65-
test_path = os.path.join(
66-
self.project.checkout_path(self.version.slug),
67-
'mkdocs.yml'
68-
)
69-
if os.path.exists(test_path):
70-
return test_path
71-
return None
64+
mkdoc_path = self.config.mkdocs.configuration
65+
if not mkdoc_path:
66+
mkdoc_path = os.path.join(
67+
self.project.checkout_path(self.version.slug),
68+
'mkdocs.yml'
69+
)
70+
if not os.path.exists(mkdoc_path):
71+
return None
72+
return mkdoc_path
7273

7374
def load_yaml_config(self):
7475
"""
@@ -198,6 +199,8 @@ def build(self):
198199
'--site-dir', self.build_dir,
199200
'--config-file', self.yaml_file,
200201
]
202+
if self.config.mkdocs.fail_on_warning:
203+
build_command.append('--strict')
201204
if self.use_theme:
202205
build_command.extend(['--theme', 'readthedocs'])
203206
cmd_ret = self.run(

0 commit comments

Comments
 (0)