Skip to content

Commit 76b3d93

Browse files
Fix links to other versions in mkdocs documentation footer
The problem was that we didn't had access to the correct page name (the relative path to the source file without the .md suffix). In order for this fix to work mkdocs needs to integrate mkdocs/mkdocs#721 and create a new release.
1 parent caea59b commit 76b3d93

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

readthedocs/doc_builder/backends/mkdocs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ def append_conf(self, **kwargs):
122122

123123
data_file = open(os.path.join(self.root_path, docs_dir, 'readthedocs-data.js'), 'w+')
124124
data_file.write(data_string)
125-
data_file.write('\nREADTHEDOCS_DATA["page"] = mkdocs_page_name')
125+
data_file.write('''
126+
READTHEDOCS_DATA["page"] = mkdocs_page_input_path.substr(
127+
0, mkdocs_page_input_path.lastIndexOf(READTHEDOCS_DATA.source_suffix));
128+
''')
126129
data_file.close()
127130

128131
include_ctx = {

0 commit comments

Comments
 (0)