You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently ignoring subdirectories by pattern is not possible.
What works is:
ignoring files by pattern by setting 'IGNORE_FILES = ["pattern1_","pattern2_","._","__"]'
ignoring specific directories by setting 'PATH_EXCLUDE = ["maindir1","maindir2/subdir"]'
What I'd suggest is another way to ignore subdirectories by pattern.
The following code adds a configuration variable 'IGNORE_SUBDIRS' analogous to 'IGNORE_FILES'.
diff --git a/pelican/generators.py b/pelican/generators.py
index 75bd6b2..20942ab 100644
--- a/pelican/generators.py
+++ b/pelican/generators.py
@@ -139,6 +139,11 @@ class Generator(object):
for e in exclusions_by_dirpath.get(dirpath, ()):
if e in dirs:
dirs.remove(e)
+ for dir in dirs:
+ #check IGNORE_SUBDIRS
+ ignores = self.settings['IGNORE_SUBDIRS']
+ if any(fnmatch.fnmatch(dir, ignore) for ignore in ignores):
+ dirs.remove(dir)
reldir = os.path.relpath(dirpath, self.path)
for f in temp_files:
fp = os.path.join(reldir, f)
Currently ignoring subdirectories by pattern is not possible.
What works is:
What I'd suggest is another way to ignore subdirectories by pattern.
The following code adds a configuration variable 'IGNORE_SUBDIRS' analogous to 'IGNORE_FILES'.
and
The text was updated successfully, but these errors were encountered: