Skip to content

Commit 9ca5858

Browse files
authored
Merge pull request #5749 from stsewd/fix-mkdocs-relpath
Fix mkdocs relpath
2 parents aed5925 + 87e419a commit 9ca5858

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

readthedocs/doc_builder/backends/mkdocs.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ def __init__(self, *args, **kwargs):
6969

7070
def get_yaml_config(self):
7171
"""Find the ``mkdocs.yml`` file in the project root."""
72-
mkdoc_path = self.config.mkdocs.configuration
73-
if not mkdoc_path:
74-
mkdoc_path = os.path.join(
75-
self.project.checkout_path(self.version.slug),
76-
'mkdocs.yml',
77-
)
78-
return mkdoc_path
72+
mkdocs_path = self.config.mkdocs.configuration
73+
if not mkdocs_path:
74+
mkdocs_path = 'mkdocs.yml'
75+
return os.path.join(
76+
self.project.checkout_path(self.version.slug),
77+
mkdocs_path,
78+
)
7979

8080
def load_yaml_config(self):
8181
"""
@@ -248,7 +248,7 @@ def build(self):
248248
'--site-dir',
249249
self.build_dir,
250250
'--config-file',
251-
self.yaml_file,
251+
os.path.relpath(self.yaml_file, self.root_path),
252252
]
253253
if self.config.mkdocs.fail_on_warning:
254254
build_command.append('--strict')

0 commit comments

Comments
 (0)