Internal links
Link to other pages in your documentation using root-relative paths. Root-relative paths start from the root of your documentation directory and work consistently regardless of where the linking page sits in your directory structure.../api-playground/overview—they break when pages move and are harder to scan during review.
Anchor links
Anchor links point to specific sections within a page. Every heading automatically generates an anchor based on its text.Link to headers on the same page
Reference headers on the current page using the hash symbol:Link to headers on other pages
Combine the page path with the anchor:How Mintlify generates anchors
Mintlify automatically creates anchors from header text by converting to lowercase, replacing spaces with hyphens, and removing special characters.| Header text | Generated anchor |
|---|---|
## Getting Started | #getting-started |
### API Authentication | #api-authentication |
#### Step 1: Install | #step-1-install |
Headers with the
noAnchor prop do not generate anchor links. See Format text for details.Custom anchor IDs
Override the auto-generated anchor for any heading by appending{#custom-id} to the header text:
#config instead of #configuration-options. Custom IDs keep anchor links stable when you update heading text—useful for headings you link to frequently. See Format text for more details.
Deep links
Deep links point to specific states or locations within a page, not just the page itself.Accordion deep links
When a user opens an accordion, the URL hash updates to reflect the open state. Visiting a URL with that hash automatically opens and scrolls to the accordion. By default, the hash derives from the accordion’stitle. Use the id property to set a custom hash:
#install instead of the auto-generated #installation-steps. See Accordions for more.
API playground deep links
To open the API playground in a link, append?playground=open to any endpoint page URL:
External links
When linking to external resources, write anchor text that makes the destination clear:Best practices
Write descriptive anchor text
Anchor text should tell users where they’re going before they click. Vague phrases like “click here” or “read more” are also weaker SEO signals than descriptive text.Link prerequisites explicitly
When a page assumes prior steps, link to them at the top rather than assuming users will find them:Build topic clusters
Link related content together to help users—and search engines—understand how your documentation is organized:Check for broken links
Run the Mintlify CLI before publishing to catch broken internal and external links:Update links when reorganizing
When moving or renaming pages:- Update the page path in your navigation configuration.
- Configure redirects from the old path to the new path.
- Search your documentation for references to the old path.
- Update all internal links to use the new path.
- Run
mint broken-linksto verify.
Use redirects for moved content
When permanently moving content, add redirects to prevent broken links for users who have bookmarked or shared old URLs.Frequently asked questions
Should I use root-relative or absolute URLs for internal links?
Should I use root-relative or absolute URLs for internal links?
Root-relative paths (starting with
/) are the right choice for internal links in Mintlify. They work consistently regardless of where the linking page sits in your directory, and they don’t break if your documentation domain changes. Absolute URLs for internal links create unnecessary brittleness.How do I keep anchor links stable when I update headings?
How do I keep anchor links stable when I update headings?
Use custom anchor IDs for headings you link to frequently. Appending
{#custom-id} to a heading decouples the anchor from the heading text, so you can update the heading text without breaking any links that point to it. This is especially useful for headings in high-traffic reference sections where the text may need refinement over time.What happens to bookmarked links when I reorganize my documentation?
What happens to bookmarked links when I reorganize my documentation?
Without redirects, bookmarked and shared links become 404 errors. Set up redirects in your
docs.json whenever you move or rename a page. Redirects are cheap to add and prevent a poor user experience for anyone who linked to your documentation from an external source—blog posts, Stack Overflow answers, internal wikis.How many internal links should a page have?
How many internal links should a page have?
Link whenever a related concept is genuinely useful to the user in that moment—not to meet a quota. Too few links leave users without context or next steps. Too many links turn the page into a navigation exercise that pulls users away from what they’re trying to do. As a rough heuristic, link the first mention of a concept or tool, and don’t repeat the same link multiple times on a single page.
Related resources
- Format text: Markdown formatting options including heading IDs and anchor behavior.
- Navigation: Configure your documentation structure.
- Redirects: Set up redirects for moved content.