mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
f32bcea560
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
70 lines
2.3 KiB
Plaintext
70 lines
2.3 KiB
Plaintext
---
|
|
title: "Exclude files from publishing"
|
|
sidebarTitle: "Exclude files"
|
|
description: "Exclude specific files and directories from your published documentation with a `.mintignore` file."
|
|
keywords: ["exclude", "ignore", "gitignore", "drafts", "private"]
|
|
---
|
|
|
|
The `.mintignore` file allows you to exclude specific files and directories in your documentation repository from being processed and published to your documentation site.
|
|
|
|
Use `.mintignore` to keep drafts, internal notes, and source files out of your public documentation while maintaining them in your repository.
|
|
|
|
## Create a .mintignore file
|
|
|
|
Create a `.mintignore` file in the root of your docs directory. This file uses the same pattern syntax as `.gitignore`.
|
|
|
|
```plaintext .mintignore
|
|
# Exclude draft documents
|
|
drafts/
|
|
*.draft.mdx
|
|
|
|
# Exclude internal documentation
|
|
internal/
|
|
|
|
# Exclude specific files
|
|
private-notes.md
|
|
```
|
|
|
|
When Mintlify builds your documentation, it reads the `.mintignore` file and excludes any matching files or directories from processing.
|
|
|
|
Excluded files:
|
|
|
|
- Don't appear in your published documentation.
|
|
- Aren't indexed for search.
|
|
- Aren't accessible to visitors.
|
|
- Are ignored by [broken link checks](/installation#find-broken-links). Links that point to ignored files are broken.
|
|
|
|
## Default ignored patterns
|
|
|
|
Mintlify automatically ignores the following directories and files without requiring any configuration:
|
|
|
|
- `.git`
|
|
- `.github`
|
|
- `.claude`
|
|
- `.agents`
|
|
- `.idea`
|
|
- `node_modules`
|
|
- `README.md`
|
|
- `LICENSE.md`
|
|
- `CHANGELOG.md`
|
|
- `CONTRIBUTING.md`
|
|
|
|
You don't need to add these to your `.mintignore` file.
|
|
|
|
<Note>
|
|
Unlike [hidden pages](/organize/hidden-pages), files excluded by `.mintignore`
|
|
are completely removed from your site and cannot be accessed by URL.
|
|
</Note>
|
|
|
|
## Pattern syntax
|
|
|
|
The `.mintignore` file follows `.gitignore` syntax. Some common patterns include:
|
|
|
|
| Pattern | Description |
|
|
| ------------------ | ---------------------------------------------- |
|
|
| `drafts/` | Excludes the entire `drafts` directory |
|
|
| `*.draft.mdx` | Excludes all files ending in `.draft.mdx` |
|
|
| `private-notes.md` | Excludes a specific file |
|
|
| `**/internal/**` | Excludes any `internal` directory at any level |
|
|
| `!important.mdx` | Negates a previous pattern (includes the file) |
|