You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/docs/pages/navigation/products.mdx
+41-46Lines changed: 41 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,58 +113,53 @@ products:
113
113
</Step>
114
114
<Step title="Add versioning to your products (optional)">
115
115
116
-
You can optionally add versions to a product. Versioned and unversioned products can live next to each other in your site. Each version of a single product has its own `yml` file.
117
-
118
-
In the below example, Product A is **unversioned** and Product B is **versioned**:
119
-
120
-
<CodeBlock>
121
-
122
-
```bash {8, 10-17}
123
-
fern/
124
-
├─ fern.config.json
125
-
├─ generators.yml
126
-
├─ docs.yml
127
-
├─ pages/
128
-
├─ ...
129
-
└─ products/
130
-
├── product-a.yml # basic unversioned product
131
-
└── product-b/ # versioned product
132
-
├─ product-b.yml
133
-
└─ versions/
134
-
├─ latest/
135
-
│ ├─ latest.yml
136
-
│ └─ pages/...
137
-
└─ v2/
138
-
├─ v2.yml
139
-
└─ pages/...
140
-
```
141
-
</CodeBlock>
116
+
You can add versions to your products by specifying the versions in your `docs.yml` configuration. Each version must have its own corresponding YAML file.
142
117
143
-
The top-level `doc.yml` configuration for a Fern Docs website containing two products, one unversioned and one versioned, might look something like this:
118
+
Here's how to structure your versioned product configuration:
path: ./products/data/versions/v2.yml # default version path
125
+
subtitle: Integrate with your API
126
+
icon: fa-light fa-database
127
+
slug: data
128
+
versions:
129
+
- display-name: v2
130
+
slug: v2.0.0
131
+
path: ./products/data/versions/v2.yml
132
+
- display-name: v2 (beta)
133
+
slug: v2.0.0-beta
134
+
path: ./products/data/versions/v2-beta.yml
135
+
- display-name: v1 (legacy)
136
+
slug: v1.0.0
137
+
path: ./products/data/versions/v1.yml
164
138
```
165
139
</CodeBlock>
166
140
167
-
For more information on setting up versioned products, follow our [versioning docs](/docs/navigation/versions).
141
+
Each version requires:
142
+
- `display-name`: The version name shown in the UI
143
+
- `path`: Path to the version's YAML configuration file
144
+
- `slug`: URL-friendly identifier for the version (optional)
145
+
146
+
Your file structure for a versioned product might look like this:
147
+
148
+
```bash
149
+
fern/
150
+
└─ products/
151
+
└─ data/
152
+
└─ versions/
153
+
├─ v2.yml
154
+
├─ v2-beta.yml
155
+
└─ v1.yml
156
+
```
157
+
158
+
<Note>
159
+
Products can be mixed between versioned and unversioned in the same documentation site. You only need to add the `versions` configuration to products that require versioning.
160
+
</Note>
161
+
162
+
For more detailed information on versioning, see our [versioning documentation](/docs/navigation/versions).
168
163
</Step>
169
164
<Step title="Remove extra navigation from docs.yml">
170
165
@@ -234,4 +229,4 @@ The dropdown menus for product and version selectors can be customized using the
234
229
<img src="webflow-version-selector.avif" alt="Example of a styled version selector" />
0 commit comments