Skip to content

Commit 8eeb728

Browse files
committed
Fix tests
1 parent 8bf99fc commit 8eeb728

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
@@ -104,7 +104,6 @@ def append_conf(self, **__):
104104
# Handle custom docs dirs
105105
user_docs_dir = user_config.get('docs_dir')
106106
docs_dir = self.docs_dir(docs_dir=user_docs_dir)
107-
docs_dir = os.path.relpath(docs_dir, self.root_path)
108107
self.create_index(extension='md')
109108
user_config['docs_dir'] = docs_dir
110109

@@ -120,11 +119,16 @@ def append_conf(self, **__):
120119
'%scss/readthedocs-doc-embed.css' % media_url,
121120
])
122121

123-
docs_path = os.path.join(self.root_path, docs_dir)
122+
# The docs path is relative to the location
123+
# of the mkdocs configuration file.
124+
docs_path = os.path.join(
125+
os.path.dirname(self.yaml_file),
126+
docs_dir
127+
)
124128

125129
# RTD javascript writing
126130
rtd_data = self.generate_rtd_data(
127-
docs_dir=docs_dir,
131+
docs_dir=os.path.relpath(docs_path, self.root_path),
128132
mkdocs_config=user_config
129133
)
130134
with open(os.path.join(docs_path, 'readthedocs-data.js'), 'w') as f:

0 commit comments

Comments
 (0)