From fb0f3d159ce733302dc4c2854423ec3900728102 Mon Sep 17 00:00:00 2001 From: Allison Thackston Date: Thu, 16 Feb 2023 22:06:23 -0800 Subject: [PATCH] Don't watch the build docs dir (#484) Before 40415a3 the plugin was creating a new temporary directory on every reload so built artifacts weren't marked as changed. After the update, the same temporary directory is used. This caused built artifacts to trigger a file change event. This fix unwatches the build docs dir so those changes don't fire rebuild events. Now only file changes in the source directory should trigger rebuilds as expected. --- mkdocs_simple_plugin/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkdocs_simple_plugin/plugin.py b/mkdocs_simple_plugin/plugin.py index 77f92ff3..ead817c1 100644 --- a/mkdocs_simple_plugin/plugin.py +++ b/mkdocs_simple_plugin/plugin.py @@ -329,7 +329,8 @@ def on_serve(self, server, *, config, builder): # watch the original docs/ directory if os.path.exists(self.orig_docs_dir): server.watch(self.orig_docs_dir) - server.watch(self.config["build_docs_dir"]) + # don't watch the build directory + server.unwatch(self.config["build_docs_dir"]) # watch all the doc files for path in self.paths: