diff --git a/docs.json b/docs.json index f5154b6f8..a69f8d23d 100644 --- a/docs.json +++ b/docs.json @@ -40,7 +40,8 @@ "organize/settings", "organize/navigation", "organize/pages", - "organize/hidden-pages" + "organize/hidden-pages", + "organize/mintignore" ] }, { @@ -340,7 +341,8 @@ "zh/organize/settings", "zh/organize/navigation", "zh/organize/pages", - "zh/organize/hidden-pages" + "zh/organize/hidden-pages", + "zh/organize/mintignore" ] }, { @@ -640,7 +642,8 @@ "es/organize/settings", "es/organize/navigation", "es/organize/pages", - "es/organize/hidden-pages" + "es/organize/hidden-pages", + "es/organize/mintignore" ] }, { @@ -940,7 +943,8 @@ "fr/organize/settings", "fr/organize/navigation", "fr/organize/pages", - "fr/organize/hidden-pages" + "fr/organize/hidden-pages", + "fr/organize/mintignore" ] }, { diff --git a/organize/mintignore.mdx b/organize/mintignore.mdx new file mode 100644 index 000000000..26b8732ac --- /dev/null +++ b/organize/mintignore.mdx @@ -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 +- **Empty lines**: Blank lines 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. + + +After modifying `.mintignore`, restart your local development server with `mint dev` to apply the changes. +