Configuring slugs

View as Markdown

By default, Fern derives each navigation item’s slug from its display name in docs.yml, lowercasing the name, replacing spaces with hyphens, and stripping special characters such as parentheses. Pages in folder-based navigation take their slugs from filenames instead.

Navigation itemSlug derived fromExampleAuto-generated slug
Productdisplay-nameMy Productmy-product
Versiondisplay-namev3 (Latest)v-3-latest
Tabdisplay-nameAPI Referenceapi-reference
Sectionsection nameKey Conceptskey-concepts
FolderDirectory name or titleapi-guidesapi-guides
Pagepage nameQuick Startquick-start

A page’s full URL joins these slugs from the outermost scope inward — product, version, tab, section and folder, then page. A page in product Platform, version v2, tab Guides, section Get Started, named Quickstart resolves to platform/v2/guides/get-started/quickstart.

You can override any segment by renaming or skipping it. When a slug is set in more than one place, precedence depends on where it’s set: a slug in docs.yml replaces only that item’s own segment, while a slug in a page’s frontmatter replaces the entire section and folder hierarchy. Product and version prefixes are always preserved.

Example without tabs
docs.yml
1instances:
2 - url: plantstore.docs.buildwithfern.com
3
4navigation:
5 - section: Get Started
6 contents:
7 - page: Welcome
8 path: ./docs/pages/welcome.mdx

In the example above, the Welcome page would be hosted at plantstore.docs.buildwithfern.com/get-started/welcome.

docs.yml
1instances:
2 - url: plantstore.docs.buildwithfern.com
3
4tabs:
5 docs:
6 display-name: Docs
7 reference:
8 display-name: API Reference
9
10navigation:
11 - tab: docs
12 layout:
13 - section: Get Started
14 contents:
15 - page: Welcome
16 path: ./docs/pages/welcome.mdx

In the example above, the Welcome page would be hosted at plantstore.docs.buildwithfern.com/docs/get-started/welcome.

You can customize these default slugs by renaming them or skipping them entirely.

Changing a slug updates the page’s URL. Run fern check to detect pages that moved without a redirect, so existing links don’t break.

Renaming slugs

Set the slug property in docs.yml or in a page’s frontmatter to customize the URL path.

Modify a tab slug

To modify the slug used for a tab, set the slug within the tabs object.

docs.yml
1tabs:
2 docs:
3 display-name: Docs
4 slug: guides
5 reference:
6 display-name: API Reference
7
8navigation:
9 - tab: docs
10 layout:
11 - section: Get Started
12 contents:
13 - page: Welcome
14 path: ./docs/pages/welcome.mdx

In the example above, the Welcome page would be hosted at plantstore.docs.buildwithfern.com/guides/get-started/welcome.

Modify a page or section slug

To modify the slug used for a page or section, set the slug within the navigation object.

docs.yml
1navigation:
2 - section: Get Started
3 slug: start
4 contents:
5 - page: Welcome
6 slug: intro
7 path: ./docs/pages/welcome.mdx

In the example above, the Welcome page would be hosted at plantstore.docs.buildwithfern.com/start/intro.

Modify a landing page’s slug

To modify the slug used for a landing page, set the slug within the landing-page object.

docs.yml
1landing-page:
2 page: Page Title
3 path: path/to/landing-page.mdx
4 slug: /welcome

Rename subheading slugs

By default, deep links to subheadings are generated by appending a # and the subheading title (converted to kebab-casing-convention) onto the page URL.

docs.yml
1navigation:
2 - section: Get Started
3 contents:
4 - page: Welcome
5 path: ./docs/pages/welcome.mdx
welcome.mdx
1...
2
3## Frequently Asked Questions
4...

The link to this section will be available at plantstore.docs.buildwithfern.com/get-started/welcome#frequently-asked-questions.

To rename the slug of a ## or ### subheading, add the desired slug:

welcome.mdx
1## Frequently Asked Questions [#faqs]

The link to this section will now be available at plantstore.docs.buildwithfern.com/get-started/welcome#faqs.

Override with a frontmatter slug

Use a frontmatter slug when a page needs a short, memorable URL independent of its sidebar position — a top-level quickstart, a campaign landing page, or a page that moved but must keep its old URL. Unlike a docs.yml slug, which replaces only its own segment, a frontmatter slug replaces the page’s entire section and folder hierarchy.

docs.yml
1navigation:
2 - section: Get Started
3 slug: start
4 contents:
5 - page: Quickstart
6 slug: quick
7 path: ./docs/pages/quickstart.mdx

With only docs.yml slugs, the page URL is plantstore.docs.buildwithfern.com/start/quick — the hierarchy is preserved. To replace that hierarchy and set the page’s path directly, set slug in the page’s frontmatter:

quickstart.mdx
1---
2slug: quickstart
3---

The page is now at plantstore.docs.buildwithfern.com/quickstart, bypassing the section hierarchy. The page still appears in the sidebar under “Get Started”, but its URL no longer reflects that structure.

Behavior with products and versions

When a page lives inside a product or version, a frontmatter slug still replaces only the section and folder portion, leaving the product and version prefixes intact.

docs.yml
1products:
2 - display-name: Platform
3 slug: platform
4 navigation:
5 - tab: guides
6 layout:
7 - section: Get Started
8 contents:
9 - page: Quickstart
10 path: ./docs/pages/quickstart.mdx
quickstart.mdx
1---
2slug: quickstart
3---

The resulting URL is plantstore.docs.buildwithfern.com/platform/quickstartnot /quickstart. The product slug platform is retained; only the section and tab hierarchy is bypassed.

The same applies to versions: a page in version “v2” of product “platform” with frontmatter slug: quickstart resolves to /platform/v2/quickstart. To move a page to the absolute root of your docs, place it outside any product or version in your navigation structure.

Skipping slugs

To ignore a tab or section when generating the slug, simply indicate skip-slug: true.

docs.yml
1instances:
2 - url: plantstore.docs.buildwithfern.com
3
4navigation:
5 - section: Get Started
6 skip-slug: true
7 contents:
8 - page: Welcome
9 path: ./docs/pages/welcome.mdx

In the example above, the Welcome page would be hosted at plantstore.docs.buildwithfern.com/welcome.

docs.yml
1instances:
2 - url: plantstore.docs.buildwithfern.com
3
4tabs:
5 docs:
6 display-name: Docs
7 skip-slug: true
8 reference:
9 display-name: API Reference
10
11navigation:
12 - tab: docs
13 layout:
14 - section: Get Started
15 skip-slug: true
16 contents:
17 - page: Welcome
18 path: ./docs/pages/welcome.mdx

In the example above, the Welcome page would be hosted at plantstore.docs.buildwithfern.com/welcome.