Skip to content

Commit 927bce1

Browse files
k-finkenethanpalm
andauthored
Add new doc describing mintignore (#1910)
* Add new doc for mintignore Add new doc for mintignore * revert docs.json title * Add mintignore to docs.json title * rename to match file name and title * Update docs.json * copyedit --------- Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>
1 parent 9a3df64 commit 927bce1

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"organize/settings",
4141
"organize/navigation",
4242
"organize/pages",
43-
"organize/hidden-pages"
43+
"organize/hidden-pages",
44+
"organize/mintignore"
4445
]
4546
},
4647
{

organize/mintignore.mdx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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

Comments
 (0)