Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"organize/settings",
"organize/navigation",
"organize/pages",
"organize/hidden-pages"
"organize/hidden-pages",
"organize/mintignore"
]
},
{
Expand Down Expand Up @@ -348,7 +349,8 @@
"fr/organize/settings",
"fr/organize/navigation",
"fr/organize/pages",
"fr/organize/hidden-pages"
"fr/organize/hidden-pages",
"organize/mintignore"
]
},
{
Expand Down Expand Up @@ -656,7 +658,8 @@
"es/organize/settings",
"es/organize/navigation",
"es/organize/pages",
"es/organize/hidden-pages"
"es/organize/hidden-pages",
"organize/mintignore"
]
},
{
Expand Down Expand Up @@ -964,7 +967,8 @@
"zh/organize/settings",
"zh/organize/navigation",
"zh/organize/pages",
"zh/organize/hidden-pages"
"zh/organize/hidden-pages",
"organize/mintignore"
]
},
{
Expand Down
162 changes: 162 additions & 0 deletions organize/mintignore.mdx
Original file line number Diff line number Diff line change
@@ -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.

Check warning on line 6 in organize/mintignore.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

organize/mintignore.mdx#L6

Use 'shouldn't' instead of 'should not'.

Check warning on line 6 in organize/mintignore.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

organize/mintignore.mdx#L6

In general, use active voice instead of passive voice ('be processed').

## 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

Check warning on line 88 in organize/mintignore.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

organize/mintignore.mdx#L88

Use 'aren't' instead of 'Are not'.
- Do not appear in your deployed documentation

Check warning on line 89 in organize/mintignore.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

organize/mintignore.mdx#L89

Use 'don't' instead of 'Do not'.
- Are not indexed for search

Check warning on line 90 in organize/mintignore.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

organize/mintignore.mdx#L90

Use 'aren't' instead of 'Are not'.
- Are not available to the AI assistant

Check warning on line 91 in organize/mintignore.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

organize/mintignore.mdx#L91

Use 'aren't' instead of 'Are not'.

<Note>
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.
</Note>

## 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

Check warning on line 148 in organize/mintignore.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

organize/mintignore.mdx#L148

'Monorepo example' should use sentence-style capitalization.

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.