Skip to content

Commit d4f8329

Browse files
committed
Fix tests
1 parent 29faa46 commit d4f8329

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

readthedocs/doc_builder/backends/mkdocs.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ def append_conf(self, **__):
9696
# Handle custom docs dirs
9797
user_docs_dir = user_config.get('docs_dir')
9898
docs_dir = self.docs_dir(docs_dir=user_docs_dir)
99-
docs_dir = os.path.relpath(docs_dir, self.root_path)
10099
self.create_index(extension='md')
101100
user_config['docs_dir'] = docs_dir
102101

@@ -112,11 +111,16 @@ def append_conf(self, **__):
112111
'%scss/readthedocs-doc-embed.css' % static_url,
113112
])
114113

115-
docs_path = os.path.join(self.root_path, docs_dir)
114+
# The docs path is relative to the location
115+
# of the mkdocs configuration file.
116+
docs_path = os.path.join(
117+
os.path.dirname(self.yaml_file),
118+
docs_dir
119+
)
116120

117121
# RTD javascript writing
118122
rtd_data = self.generate_rtd_data(
119-
docs_dir=docs_dir,
123+
docs_dir=os.path.relpath(docs_path, self.root_path),
120124
mkdocs_config=user_config
121125
)
122126
with open(os.path.join(docs_path, 'readthedocs-data.js'), 'w') as f:

0 commit comments

Comments
 (0)