Skip to content

Commit

Permalink
Don't watch the build docs dir (#484)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
athackst authored Feb 17, 2023
1 parent a2a26e9 commit fb0f3d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mkdocs_simple_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fb0f3d1

Please sign in to comment.