From 114f4e2d42c3fb3526b47418a1cd1de44f948b44 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Tue, 2 Apr 2024 21:36:12 +0200 Subject: [PATCH] remove subdirectories for the ones skipped with ignore_dirs --- src/sigal/gallery.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sigal/gallery.py b/src/sigal/gallery.py index 58f927b..4ffd83c 100644 --- a/src/sigal/gallery.py +++ b/src/sigal/gallery.py @@ -734,6 +734,11 @@ class Gallery: fnmatch.fnmatch(relpath, ignore) for ignore in ignore_dirs ): self.logger.info("Ignoring %s", relpath) + # Remove sub-directories + for d in dirs[:]: + path = join(relpath, d) if relpath != "." else d + if path in albums.keys(): + del albums[path] continue # Remove files that match the ignore_files settings