Skip to content

Commit ce5e16d

Browse files
committed
Update products.mdx based on issue #216
1 parent 23b6302 commit ce5e16d

File tree

1 file changed

+41
-46
lines changed

1 file changed

+41
-46
lines changed

fern/products/docs/pages/navigation/products.mdx

Lines changed: 41 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -113,58 +113,53 @@ products:
113113
</Step>
114114
<Step title="Add versioning to your products (optional)">
115115

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.
142117

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:
144119

145120
<CodeBlock title="docs.yml">
146-
```yaml {2, 8, 13-17}
121+
```yaml
147122
products:
148-
- display-name: Product A # unversioned
149-
path: ./products/product-a.yml
150-
icon: fa-solid fa-leaf # optional
151-
slug: product-a # optional
152-
subtitle: Product A subtitle # optional
153-
154-
- display-name: Product B # versioned
155-
path: ./products/product-b/latest.yml # <-- default showing latest
156-
image: ./images/product-b.png # optional
157-
slug: product-b # optional
158-
subtitle: Product B subtitle # optional
159-
versions: # optional
160-
- display-name: Latest
161-
path: ./products/product-b/latest.yml
162-
- display-name: V2
163-
path: ./products/product-b/v2.yml
123+
- display-name: Data API
124+
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
164138
```
165139
</CodeBlock>
166140

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).
168163
</Step>
169164
<Step title="Remove extra navigation from docs.yml">
170165

@@ -234,4 +229,4 @@ The dropdown menus for product and version selectors can be customized using the
234229
<img src="webflow-version-selector.avif" alt="Example of a styled version selector" />
235230
</Frame>
236231
</Tab>
237-
</Tabs>
232+
</Tabs>

0 commit comments

Comments
 (0)