-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chdeskur/api-key-injection
- Loading branch information
Showing
300 changed files
with
42,639 additions
and
3,308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
--- | ||
title: Versioning | ||
subtitle: Allow users to navigate between different versions of your docs. | ||
--- | ||
|
||
<Frame> | ||
![A dropdown of the available versions](versions.png) | ||
</Frame> | ||
|
||
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:** | ||
|
||
<Steps> | ||
### 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. | ||
|
||
```bash | ||
fern/ | ||
├─ fern.config.json | ||
├─ generators.yml | ||
├─ docs.yml | ||
├─ pages/ | ||
├─ ... | ||
└─ versions/ | ||
├─ v2-1/pages/... | ||
├─ v2-1.yml | ||
├─ v2-2/pages/... | ||
└─ v2-2.yml | ||
``` | ||
|
||
<CodeBlocks> | ||
<CodeBlock title="versions/v2-1.yml"> | ||
```yaml | ||
navigation: | ||
- section: Introduction | ||
contents: | ||
- page: My Page | ||
path: ./v2-1/pages/my-page.mdx # relative path to the file | ||
- page: Shared Resource | ||
path: ../shared-pages/shared-resource.mdx | ||
- api: API Reference | ||
``` | ||
</CodeBlock> | ||
<CodeBlock title="versions/v2-2.yml"> | ||
```yaml | ||
tabs: | ||
api: | ||
title: API Reference | ||
icon: puzzle | ||
help: | ||
title: Help Center | ||
icon: home | ||
|
||
navigation: | ||
- tab: api | ||
contents: | ||
- section: Introduction | ||
contents: | ||
- page: My Page | ||
path: ./v2-2/pages/my-page.mdx # relative path to the file | ||
- page: Shared Resource | ||
path: ../shared-pages/shared-resource.mdx | ||
- api: API Reference | ||
- tab: help | ||
contents: | ||
- section: Help Center | ||
contents: | ||
- page: Contact Us | ||
path: contact-us.mdx | ||
``` | ||
</CodeBlock> | ||
</CodeBlocks> | ||
### Add your version configuration | ||
To define a version, in `docs.yml`, add an item to the `versions` list, specifying the `display-name` and `path`. | ||
|
||
```bash | ||
fern/ | ||
├─ fern.config.json | ||
├─ generators.yml | ||
├─ docs.yml | ||
└─ versions/ | ||
├─ ... | ||
├─ v2-1.yml | ||
└─ v2-2.yml | ||
``` | ||
|
||
<CodeBlock title="docs.yml"> | ||
```yaml | ||
versions: | ||
- display-name: v2.2 # shown in the dropdown | ||
path: ./versions/v2-2.yml # relative path to the version file | ||
- display-name: v2.1 | ||
path: ./versions/v2-1.yml | ||
``` | ||
</CodeBlock> | ||
|
||
### 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. | ||
</Steps> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.