getpelican/pelican — pull request #1501 by foresto (2014-10-13 05:16:58+00:00)
Title: Make PAGE_EXCLUDES and ARTICLE_EXCLUDES work with subdirs. Fixes #1500.

The old code was naïvely comparing the strings in `PAGE_EXCLUDES` to the subdirectory names produced by `os.walk()`. This had two surprising effects:

- Setting `PAGE_EXCLUDES=['foo']` would exclude all directories named `foo`, regardless of whether they were in the top-level content directory or nested within a directory whose entire contents should be included.
- Setting `PAGE_EXCLUDES=['subdir/foo']` would never exclude any directories.

In other words, there was no way to exclude a subdirectory without risking the accidental exclusion of directories elsewhere with the same name. `ARTICLE_EXCLUDES` had the same problem.

This change fixes the problem, so `'subdir/foo'` and `'foo'` will be distinct and both work as expected. If anyone out there is depending on the old behavior, they will have to update their settings. I don't expect it to affect many users yet, since Pelican doesn't yet make nested directory structures very useful. When it does, this fix will become important to more people. (It's important to me now, since I happen to be working on improving Pelican in this area.)