|
| 1 | +--- |
| 2 | +title: "Mintignore" |
| 3 | +description: "Exclude specific files and directories from your published documentation." |
| 4 | +keywords: ["exclude", "ignore", "gitignore", "drafts", "private"] |
| 5 | +--- |
| 6 | + |
| 7 | +The `.mintignore` file allows you to exclude specific files and directories from being processed and published to your documentation site. |
| 8 | + |
| 9 | +Use `.mintignore` to keep drafts, internal notes, and source files out of your public documentation while maintaining them in your repository. |
| 10 | + |
| 11 | +## Create a .mintignore file |
| 12 | + |
| 13 | +Create a `.mintignore` file in the root of your docs directory. This file uses the same pattern syntax as `.gitignore`. |
| 14 | + |
| 15 | +```plaintext .mintignore |
| 16 | +# Exclude draft documents |
| 17 | +drafts/ |
| 18 | +*.draft.mdx |
| 19 | +
|
| 20 | +# Exclude internal documentation |
| 21 | +internal/ |
| 22 | +
|
| 23 | +# Exclude specific files |
| 24 | +private-notes.md |
| 25 | +``` |
| 26 | + |
| 27 | +When Mintlify builds your documentation, it reads the `.mintignore` file and excludes any matching files or directories from processing. |
| 28 | + |
| 29 | +Excluded files: |
| 30 | +- Don't appear in your published documentation. |
| 31 | +- Aren't indexed for search. |
| 32 | +- Aren't accessible to visitors. |
| 33 | + |
| 34 | +<Note> |
| 35 | + Unlike [hidden pages](/organize/hidden-pages), files excluded by `.mintignore` are completely removed from your site and cannot be accessed by URL. |
| 36 | +</Note> |
| 37 | + |
| 38 | +## Pattern syntax |
| 39 | + |
| 40 | +The `.mintignore` file follows `.gitignore` syntax. Some common patterns include: |
| 41 | + |
| 42 | +| Pattern | Description | |
| 43 | +| ------------------ | ---------------------------------------------- | |
| 44 | +| `drafts/` | Excludes the entire `drafts` directory | |
| 45 | +| `*.draft.mdx` | Excludes all files ending in `.draft.mdx` | |
| 46 | +| `private-notes.md` | Excludes a specific file | |
| 47 | +| `**/internal/**` | Excludes any `internal` directory at any level | |
| 48 | +| `!important.mdx` | Negates a previous pattern (includes the file) | |
0 commit comments