1
Fork 0
mkdocs-site/hooks/exclude-static.py

19 lines
413 B
Python
Raw Normal View History

2023-09-17 17:41:09 +01:00
import fnmatch
from mkdocs.plugins import event_priority, get_plugin_logger
EXCLUDED_FILES = {
"*.mmd"
}
logger = get_plugin_logger("exclude-static")
@event_priority(100)
def on_files(files, config):
for file in files:
if any(fnmatch.fnmatch(file.url, pattern) for pattern in EXCLUDED_FILES):
logger.debug("Excluding %s", file.url)
files.remove(file)
return files