diff --git a/docs.json b/docs.json index 8355abedf..d5cf75b68 100644 --- a/docs.json +++ b/docs.json @@ -40,7 +40,8 @@ "organize/settings", "organize/navigation", "organize/pages", - "organize/hidden-pages" + "organize/hidden-pages", + "organize/mintignore" ] }, { @@ -348,7 +349,8 @@ "fr/organize/settings", "fr/organize/navigation", "fr/organize/pages", - "fr/organize/hidden-pages" + "fr/organize/hidden-pages", + "organize/mintignore" ] }, { @@ -656,7 +658,8 @@ "es/organize/settings", "es/organize/navigation", "es/organize/pages", - "es/organize/hidden-pages" + "es/organize/hidden-pages", + "organize/mintignore" ] }, { @@ -964,7 +967,8 @@ "zh/organize/settings", "zh/organize/navigation", "zh/organize/pages", - "zh/organize/hidden-pages" + "zh/organize/hidden-pages", + "organize/mintignore" ] }, { diff --git a/organize/mintignore.mdx b/organize/mintignore.mdx new file mode 100644 index 000000000..da30ab829 --- /dev/null +++ b/organize/mintignore.mdx @@ -0,0 +1,162 @@ +--- +title: ".mintignore" +description: "Exclude files and folders from your documentation build" +--- + +Use `.mintignore` to exclude specific files and folders from your documentation build. This file works exactly like `.gitignore`, allowing you to define patterns for content that should not be processed or deployed. + +## Creating a `.mintignore` file + +Create a `.mintignore` file in the root of your documentation directory. The file uses the same syntax and pattern matching as `.gitignore`. + +```text .mintignore +# Ignore draft content +drafts/ + +# Ignore temporary files +*.tmp +*.bak + +# Ignore specific files +internal-notes.mdx +team-only.mdx + +# Ignore all files in a directory except one +secret/* +!secret/public-info.mdx +``` + +## Pattern syntax + +`.mintignore` supports standard gitignore pattern matching: + +- `*` matches any string of characters except `/` +- `**` matches any string of characters including `/` +- `?` matches any single character except `/` +- `[abc]` matches any character inside the brackets +- Lines starting with `#` are comments +- Lines starting with `!` negate previous patterns + +## Common use cases + +### Ignore draft content + +Exclude work-in-progress documentation from your build: + +```text +drafts/ +wip/ +*.draft.mdx +``` + +### Ignore internal documentation + +Keep internal notes and team-specific content out of your public docs: + +```text +internal/ +team-notes/ +*-internal.mdx +``` + +### Ignore temporary files + +Exclude backup files and editor artifacts: + +```text +*.tmp +*.bak +*.swp +*~ +.DS_Store +``` + +### Ignore test files + +Exclude test content used during development: + +```text +test/ +*.test.mdx +examples/sandbox/ +``` + +## How it works + +When you build your documentation, Mintlify reads the `.mintignore` file and excludes any matching files and folders from processing. Ignored files: + +- Are not processed during the build +- Do not appear in your deployed documentation +- Are not indexed for search +- Are not available to the AI assistant + + + Files excluded by `.mintignore` are completely removed from the build. If you want to keep files accessible by URL but hidden from navigation, use [hidden pages](/organize/hidden-pages) instead. + + +## Differences from hidden pages + +`.mintignore` and [hidden pages](/organize/hidden-pages) serve different purposes: + +| Feature | `.mintignore` | Hidden pages | +|---------|---------------|--------------| +| Included in build | No | Yes | +| Accessible by URL | No | Yes | +| Indexed for search | No | Optional | +| Available to AI assistant | No | Optional | +| Use case | Exclude from deployment | Hide from navigation | + +## Examples + +### Basic example + +```text .mintignore +# Ignore all draft content +drafts/ + +# Ignore specific files +internal-roadmap.mdx +team-meeting-notes.mdx +``` + +### Advanced example + +```text .mintignore +# Ignore all markdown files in the temp directory +temp/**/*.mdx + +# Ignore all files starting with underscore +_* + +# But don't ignore _meta.json files +!_meta.json + +# Ignore backup files +*.bak +*.tmp + +# Ignore OS files +.DS_Store +Thumbs.db + +# Ignore editor files +*.swp +*.swo +*~ +``` + +### Monorepo example + +For monorepo setups, place `.mintignore` in your documentation directory: + +```text +/your-monorepo + |- packages/ + |- apps/ + |- docs/ + |- .mintignore + |- docs.json + |- index.mdx +``` + +The patterns in `.mintignore` are relative to the documentation directory, not the repository root.