Allow users to navigate between different versions of your docs.

A dropdown of the available versions

Each version of your docs can contain its own distinct tabs, sections, pages, and API references. Versions can share content, as well.

To add versions to your docs:

1

Define your versions

Create a versions folder inside of your fern folder. TO specify the contents of each version, add a .yml file to the versions folder to define the navigational structure of that version. Make sure to include the navigation and tabs properties, if applicable.

$fern/
> ├─ fern.config.json
> ├─ generators.yml
> ├─ docs.yml
> ├─ pages/
> ├─ ...
> └─ versions/
> ├─ v2-1/pages/...
> ├─ v2-1.yml
> ├─ v2-2/pages/...
> └─ v2-2.yml
1navigation:
2 - section: Introduction
3 contents:
4 - page: My Page
5 path: ./v2-1/pages/my-page.mdx # relative path to the file
6 - page: Shared Resource
7 path: ../shared-pages/shared-resource.mdx
8 - api: API Reference
2

Add your version configuration

To define a version, in docs.yml, add an item to the versions list, specifying the display-name and path.

$fern/
> ├─ fern.config.json
> ├─ generators.yml
> ├─ docs.yml
> └─ versions/
> ├─ ...
> ├─ v2-1.yml
> └─ v2-2.yml
docs.yml
1versions:
2 - display-name: v2.2 # shown in the dropdown
3 path: ./versions/v2-2.yml # relative path to the version file
4 - display-name: v2.1
5 path: ./versions/v2-1.yml
3

Remove extra navigation from docs.yml

If your docs.yml file includes a navigation field or a tabs field, be sure to remove. Those fields should now belong in the version-specific .yml files.