mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Add option follow_links controling the docs_dir walker to follow directories links (#1134)
This commit is contained in:
committed by
Waylan Limberg
parent
9f5365a496
commit
5bdd4a62a8
@@ -466,7 +466,7 @@ class Pages(OptionallyRequired):
|
||||
if self.file_match is None:
|
||||
raise StopIteration
|
||||
|
||||
for (dirpath, dirs, filenames) in os.walk(docs_dir):
|
||||
for (dirpath, dirs, filenames) in os.walk(docs_dir, followlinks=True):
|
||||
dirs.sort()
|
||||
for filename in sorted(filenames):
|
||||
fullpath = os.path.join(dirpath, filename)
|
||||
@@ -474,8 +474,8 @@ class Pages(OptionallyRequired):
|
||||
# Some editors (namely Emacs) will create temporary symlinks
|
||||
# for internal magic. We can just ignore these files.
|
||||
if os.path.islink(fullpath):
|
||||
fp = os.path.join(dirpath, os.readlink(fullpath))
|
||||
if not os.path.exists(fp):
|
||||
local_fullpath = os.path.join(dirpath, os.readlink(fullpath))
|
||||
if not os.path.exists(local_fullpath):
|
||||
continue
|
||||
|
||||
relpath = os.path.normpath(os.path.relpath(fullpath, docs_dir))
|
||||
|
||||
Reference in New Issue
Block a user