mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
ignoring specific subdirectories by setting 'IGNORE_SUBDIRS'
This commit is contained in:
parent
5dbe3d4205
commit
eb7c33004f
1 changed files with 2 additions and 4 deletions
|
|
@ -149,6 +149,7 @@ class Generator:
|
|||
|
||||
files = set()
|
||||
ignores = self.settings['IGNORE_FILES']
|
||||
subignores = self.settings['IGNORE_SUBDIRS']
|
||||
|
||||
for path in paths:
|
||||
# careful: os.path.join() will add a slash when path == ''.
|
||||
|
|
@ -160,11 +161,8 @@ class Generator:
|
|||
excl = exclusions_by_dirpath.get(dirpath, ())
|
||||
# We copy the `dirs` list as we will modify it in the loop:
|
||||
# ----
|
||||
for dir in dirs:
|
||||
# check the IGNORE_SUBDIRS
|
||||
subdirignores = self.settings['IGNORE_SUBDIRS']
|
||||
|
||||
if any(fnmatch.fnmatch(dir, willignore) for willignore in subdirignores):
|
||||
if any(fnmatch.fnmatch(dir, willignore) for willignore in subignores):
|
||||
dirs.remove(dir)
|
||||
# ----
|
||||
for d in list(dirs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue