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 @@ -340,7 +341,8 @@
"zh/organize/settings",
"zh/organize/navigation",
"zh/organize/pages",
"zh/organize/hidden-pages"
"zh/organize/hidden-pages",
"zh/organize/mintignore"
]
},
{
Expand Down Expand Up @@ -640,7 +642,8 @@
"es/organize/settings",
"es/organize/navigation",
"es/organize/pages",
"es/organize/hidden-pages"
"es/organize/hidden-pages",
"es/organize/mintignore"
]
},
{
Expand Down Expand Up @@ -940,7 +943,8 @@
"fr/organize/settings",
"fr/organize/navigation",
"fr/organize/pages",
"fr/organize/hidden-pages"
"fr/organize/hidden-pages",
"fr/organize/mintignore"
]
},
{
Expand Down
102 changes: 102 additions & 0 deletions organize/mintignore.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
title: ".mintignore"
description: "Exclude files and directories from your Mintlify build."
keywords: ["mintignore", "ignore files", "exclude files", "build optimization"]
---

Use a `.mintignore` file to exclude files and directories from your Mintlify build process. This is useful for keeping your documentation clean by excluding drafts, temporary files, or other content you don't want to publish.

## Creating a `.mintignore` file

Create a `.mintignore` file in the root of your documentation repository, next to your `docs.json` file.

```text
/your-project
|- docs.json
|- .mintignore
|- index.mdx
```

## Syntax

The `.mintignore` file follows the same syntax as `.gitignore` files. Each line specifies a pattern for files or directories to exclude.

```text .mintignore
# Exclude draft files
drafts/

# Exclude temporary files
*.tmp
temp-*.mdx

# Exclude specific files
notes.md
internal-docs.mdx
```

### Pattern rules

- **Comments**: Lines starting with `#` are treated as comments

Check warning on line 39 in organize/mintignore.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

organize/mintignore.mdx#L39

In general, use active voice instead of passive voice ('are treated').
- **Empty lines**: Blank lines are ignored

Check warning on line 40 in organize/mintignore.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

organize/mintignore.mdx#L40

In general, use active voice instead of passive voice ('are ignored').
- **Directories**: End patterns with `/` to match directories
- **Wildcards**: Use `*` to match any characters
- **Negation**: Start patterns with `!` to negate a previous ignore pattern

## Default ignored files

Mintlify automatically ignores the following files and directories, even without a `.mintignore` file:

- `.git`
- `.github`
- `.claude`
- `.agents`
- `node_modules`

You don't need to add these to your `.mintignore` file.

## Examples

### Exclude draft content

```text .mintignore
# Ignore all draft files
drafts/
*-draft.mdx
```

### Exclude work-in-progress files

```text .mintignore
# Ignore WIP files
wip/
*-wip.mdx
TODO.md
```

### Exclude internal documentation

```text .mintignore
# Internal docs
internal/
team-notes/
*.internal.mdx
```

### Exclude specific file types

```text .mintignore
# Exclude all markdown files in a specific directory
archive/*.md

# Exclude backup files
*.bak
*~
```

## Local development

When running `mint dev`, changes to your `.mintignore` file require restarting the development server to take effect.

<Note>
After modifying `.mintignore`, restart your local development server with `mint dev` to apply the changes.
</Note>