Skip to content

Fix mkdocs relpath #5749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions readthedocs/doc_builder/backends/mkdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ def __init__(self, *args, **kwargs):

def get_yaml_config(self):
"""Find the ``mkdocs.yml`` file in the project root."""
mkdoc_path = self.config.mkdocs.configuration
if not mkdoc_path:
mkdoc_path = os.path.join(
self.project.checkout_path(self.version.slug),
'mkdocs.yml',
)
return mkdoc_path
mkdocs_path = self.config.mkdocs.configuration
if not mkdocs_path:
mkdocs_path = 'mkdocs.yml'
return os.path.join(
self.project.checkout_path(self.version.slug),
mkdocs_path,
)

def load_yaml_config(self):
"""
Expand Down Expand Up @@ -248,7 +248,7 @@ def build(self):
'--site-dir',
self.build_dir,
'--config-file',
self.yaml_file,
os.path.relpath(self.yaml_file, self.root_path),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One test was expecting this call to be relative to the checkout path, but with the new change this was a full path.
Relative path is shorter to show in the output and we are already setting the cwd to the checkout path, so we are fine.

]
if self.config.mkdocs.fail_on_warning:
build_command.append('--strict')
Expand Down