Customizing slugs within your site
By default, Fern generates the slug of a page based on the navigation structure in the docs.yml file.
Example without tabs
In the example above, the Welcome page would be hosted at plantstore.docs.buildwithfern.com/get-started/welcome.
Example with tabs
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.
Renaming slugs
Set the slug property in docs.yml or in a page’s frontmatter to customize the URL path.
Modify a page or section slug
To modify the slug used for a page or section, you can set the slug within the navigation object.
In the example above, the Welcome page would be hosted at plantstore.docs.buildwithfern.com/start/intro.
Modify a tab slug
To modify the slug used for a tab, you can set the slug within the tabs object.
In the example above, the Welcome page would be hosted at plantstore.docs.buildwithfern.com/guides/get-started/welcome.
Modify a landing page’s slug
To modify the slug used for a landing page, you can set the slug within the landing-page object.
Override a page’s slug with frontmatter
Frontmatter slugs take precedence over slugs generated or set in docs.yml, giving you full control over a page’s URL.
With this configuration, the page would normally be at plantstore.docs.buildwithfern.com/start/quickstart. To override this, set slug in the page’s frontmatter:
The page is now available at plantstore.docs.buildwithfern.com/start/start-up instead. See frontmatter configuration for more details.
Renaming slugs for subheadings
By default, deep links to subheadings are generated by appending a # and the subheading title (converted to kebab-casing-convention) onto the page URL.
The link to this section will be available at plantstore.docs.buildwithfern.com/get-started/welcome#frequently-asked-questions.
To rename the slug of the subheading, add the desired slug:
The link to this section will now be available at plantstore.docs.buildwithfern.com/get-started/welcome#faqs.
Skipping slugs
To ignore a tab or section when generating the slug, simply indicate skip-slug: true.
Example without tabs defaultOpen
In the example above, the Welcome page would be hosted at plantstore.docs.buildwithfern.com/welcome.
Example with tabs
In the example above, the Welcome page would be hosted at plantstore.docs.buildwithfern.com/welcome.