docs: document the exclude codegraph.json option (#999) (#1010)

#1009 added `exclude` (keep git-tracked dirs out of the index) but didn't
document it. Add an "Excluding a tracked directory" section to the site config
page (parallel to includeIgnored) and a brief note + example to the README,
covering the committed-theme/SDK case .gitignore can't handle.
This commit is contained in:
Colby Mchenry
2026-06-26 20:30:24 -05:00
committed by GitHub
parent 45d3293c6a
commit 7a361ef16e
2 changed files with 28 additions and 2 deletions
+12
View File
@@ -606,6 +606,18 @@ add a negation — `!vendor/`. The defaults apply uniformly, so committing a
dependency or build directory doesn't force it into the graph; the `.gitignore`
negation is the explicit opt-in.
`.gitignore` can't drop a directory you've **committed**, though. For a vendored
theme or SDK that's checked into the repo (e.g. a Metronic theme under
`static/`), list it under `exclude` in `codegraph.json` — gitignore-style
patterns, matched against repo-root-relative paths, honored on index, sync, and
watch:
```json
{
"exclude": ["static/", "**/vendor/**"]
}
```
### Custom file extensions
If your project uses a non-standard extension for a [supported