From eb7c33004fc8b2fde30e8e650b3f4aaf7ab505f9 Mon Sep 17 00:00:00 2001 From: Rayan Date: Wed, 7 Apr 2021 00:40:33 -0400 Subject: [PATCH] ignoring specific subdirectories by setting 'IGNORE_SUBDIRS' --- pelican/generators.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index f8031a62..ab90b25a 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -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):