Summary
addDirRecursive is called once at startup with the original cfg.Build.DocsDir. If docs_dir is changed in kwelea.toml while kwelea serve is running, the config reloads correctly (fixed in #39) but the fsnotify watcher still watches the old directory tree. Edits under the new docs_dir won't trigger rebuilds until the server restarts.
Current behaviour
- Start
kwelea serve — watcher covers docs/
- Edit
kwelea.toml: docs_dir = "content/docs"
- Config reloads, next rebuild uses
content/docs ✅
- Edit a file under
content/docs/ — no rebuild fires ❌
Expected behaviour
After a docs_dir change is picked up from kwelea.toml, the watcher should stop watching the old tree and start watching the new one.
Proposed solution
In watch, after a successful config reload, compare old and new DocsDir. If changed:
- Remove the old tree from the watcher (or close and recreate the watcher)
- Call
addDirRecursive with the new DocsDir
Origin
Surfaced during review of PR #39. Noted by the reviewer as pre-existing behaviour, not introduced by that PR.
Summary
addDirRecursiveis called once at startup with the originalcfg.Build.DocsDir. Ifdocs_diris changed inkwelea.tomlwhilekwelea serveis running, the config reloads correctly (fixed in #39) but the fsnotify watcher still watches the old directory tree. Edits under the newdocs_dirwon't trigger rebuilds until the server restarts.Current behaviour
kwelea serve— watcher coversdocs/kwelea.toml:docs_dir = "content/docs"content/docs✅content/docs/— no rebuild fires ❌Expected behaviour
After a
docs_dirchange is picked up fromkwelea.toml, the watcher should stop watching the old tree and start watching the new one.Proposed solution
In
watch, after a successful config reload, compare old and newDocsDir. If changed:addDirRecursivewith the newDocsDirOrigin
Surfaced during review of PR #39. Noted by the reviewer as pre-existing behaviour, not introduced by that PR.