From 661901070269471f81cba4a6b23ef5f25af18fd2 Mon Sep 17 00:00:00 2001 From: Dougal Matthews Date: Wed, 17 Feb 2016 21:46:54 +0000 Subject: [PATCH] Handle relative paths in symlinks Fixes #639 --- docs/about/release-notes.md | 1 + mkdocs/config/config_options.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/about/release-notes.md b/docs/about/release-notes.md index 3814af86..c3d4787d 100644 --- a/docs/about/release-notes.md +++ b/docs/about/release-notes.md @@ -17,6 +17,7 @@ You can determine your currently installed version using `mkdocs --version`: ## Version 0.15.3 (2016-02-??) * Improve the error message the given theme can't be found. +* Fix an issue with relative symlinks (#639) ## Version 0.15.2 (2016-02-08) diff --git a/mkdocs/config/config_options.py b/mkdocs/config/config_options.py index c80968df..8eb09b98 100644 --- a/mkdocs/config/config_options.py +++ b/mkdocs/config/config_options.py @@ -352,7 +352,8 @@ class Extras(OptionallyRequired): # Some editors (namely Emacs) will create temporary symlinks # for internal magic. We can just ignore these files. if os.path.islink(fullpath): - if not os.path.exists(os.readlink(fullpath)): + fp = os.path.join(dirpath, os.readlink(fullpath)) + if not os.path.exists(fp): continue relpath = os.path.normpath(os.path.relpath(fullpath, docs_dir))