From ad8a1879cfe6fb4f86eb7e89840f5f1404162372 Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Sun, 21 Aug 2022 20:32:52 +0200 Subject: [PATCH] Replace backslashes only on Windows --- mkdocs_redirects/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs_redirects/plugin.py b/mkdocs_redirects/plugin.py index ece6a2d..575ce2b 100644 --- a/mkdocs_redirects/plugin.py +++ b/mkdocs_redirects/plugin.py @@ -118,7 +118,7 @@ def on_files(self, files, config, **kwargs): # Build a dict of known document pages to validate against later self.doc_pages = {} for page in files.documentation_pages(): # object type: mkdocs.structure.files.File - self.doc_pages[page.src_path.replace('\\', '/')] = page + self.doc_pages[page.src_path.replace(os.sep, '/')] = page # Create HTML files for redirects after site dir has been built def on_post_build(self, config, **kwargs):