From 1edca552532ae3f3dc72ee4a2bd8109d2b293fdc Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Sun, 10 Nov 2024 12:05:02 +1100 Subject: [PATCH] settings: Change the default IGNORE_FILES to all "hidden" files. This is to avoid subtle behaviour that contributed to root cause of https://github.com/pelican-plugins/sitemap/issues/36 Specifically: if installing Pelican into a local virtualenv with the pdm or uv default name ".venv", then subdirectories of .venv will contain all of the test .rst and .md files. If you then run Pelican in that same root directory using the default PATH value (".") then it will add those content files to the site. --- docs/settings.rst | 10 +++++----- pelican/settings.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 93c632d2..b442451a 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -150,12 +150,12 @@ Basic settings READERS = {'foo': FooReader} -.. data:: IGNORE_FILES = ['.#*'] +.. data:: IGNORE_FILES = ['.*'] - A list of glob patterns. Files and directories matching any of these - patterns will be ignored by the processor. For example, the default - ``['.#*']`` will ignore emacs lock files, and ``['__pycache__']`` would - ignore Python 3's bytecode caches. + A list of glob patterns. Files and directories matching any of these patterns + will be ignored by the processor. For example, the default ``['.*']`` will + ignore "hidden" files and directories, and ``['__pycache__']`` would ignore + Python 3's bytecode caches. .. data:: MARKDOWN = {...} diff --git a/pelican/settings.py b/pelican/settings.py index 66d6beeb..1c6b5c76 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -157,7 +157,7 @@ DEFAULT_CONFIG = { "PYGMENTS_RST_OPTIONS": {}, "TEMPLATE_PAGES": {}, "TEMPLATE_EXTENSIONS": [".html"], - "IGNORE_FILES": [".#*"], + "IGNORE_FILES": [".*"], "SLUG_REGEX_SUBSTITUTIONS": [ (r"[^\w\s-]", ""), # remove non-alphabetical/whitespace/'-' chars (r"(?u)\A\s*", ""), # strip leading whitespace