Skip to content

Commit 59ae212

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

File tree

1 file changed

+59
-57
lines changed

1 file changed

+59
-57
lines changed

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

Lines changed: 59 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -92,79 +92,81 @@ The optional parameters are: `image`, `icon`, `subtitle`, `slug`, and `versions`
9292

9393
<Note>If you provide both an `image` and an `icon`, the `image` will take precedence.</Note>
9494

95-
The below example is a `docs.yml` configuration for a site with two products, Product A and Product B.
95+
The below example is a `docs.yml` configuration for a site with two products:
9696

9797
<CodeBlock title="docs.yml">
98-
```yaml {2-3, 8-9}
98+
```yaml
9999
products:
100-
- display-name: Product A
101-
path: ./products/product-a.yml
102-
icon: fa-solid fa-leaf # optional
103-
slug: product-a # optional
104-
subtitle: Product A subtitle # optional
105-
106-
- display-name: Product B
107-
path: ./products/product-b/latest.yml # <-- default showing latest
108-
image: ./images/product-b.png # optional
109-
slug: product-b # optional
110-
subtitle: Product B subtitle # optional
100+
- display-name: Data API
101+
path: ./products/data/versions/v2.yml
102+
subtitle: Integrate with Webflow
103+
icon: fa-light fa-database
104+
image: ./assets/product-selector/data-api-image.svg
105+
slug: data
106+
versions:
107+
- display-name: v2
108+
slug: v2.0.0
109+
path: ./products/data/versions/v2.yml
110+
- display-name: v2 (beta)
111+
slug: v2.0.0-beta
112+
path: ./products/data/versions/v2-beta.yml
113+
- display-name: v1 (legacy)
114+
slug: v1.0.0
115+
path: ./products/data/versions/v1.yml
116+
117+
- display-name: Commerce API
118+
path: ./products/commerce.yml
119+
subtitle: Power custom commerce experiences
120+
icon: fa-light fa-shopping-cart
121+
image: ./assets/product-selector/commerce-api-image.svg
122+
slug: commerce
111123
```
112124
</CodeBlock>
113125
</Step>
114126
<Step title="Add versioning to your products (optional)">
115127

116128
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.
117129

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>
130+
To add versions to a product:
142131

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:
132+
1. Create a `versions` folder inside your product directory
133+
2. Add a yml file for each version
134+
3. Configure the versions in your product's entry in docs.yml:
144135

145136
<CodeBlock title="docs.yml">
146-
```yaml {2, 8, 13-17}
137+
```yaml
147138
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
139+
- display-name: Data API
140+
path: ./products/data/versions/v2.yml # Default version shown
141+
subtitle: Integrate with Webflow
142+
icon: fa-light fa-database
143+
slug: data
144+
versions:
145+
- display-name: v2
146+
slug: v2.0.0
147+
path: ./products/data/versions/v2.yml
148+
- display-name: v2 (beta)
149+
slug: v2.0.0-beta
150+
path: ./products/data/versions/v2-beta.yml
151+
- display-name: v1 (legacy)
152+
slug: v1.0.0
153+
path: ./products/data/versions/v1.yml
164154
```
165155
</CodeBlock>
166156

167-
For more information on setting up versioned products, follow our [versioning docs](/docs/navigation/versions).
157+
The folder structure would look like:
158+
159+
```bash
160+
fern/
161+
└─ products/
162+
└─ data/
163+
└─ versions/
164+
├─ v2.yml
165+
├─ v2-beta.yml
166+
└─ v1.yml
167+
```
168+
169+
For more information on versioning, see our [versioning docs](/docs/navigation/versions).
168170
</Step>
169171
<Step title="Remove extra navigation from docs.yml">
170172

@@ -234,4 +236,4 @@ The dropdown menus for product and version selectors can be customized using the
234236
<img src="webflow-version-selector.avif" alt="Example of a styled version selector" />
235237
</Frame>
236238
</Tab>
237-
</Tabs>
239+
</Tabs>

0 commit comments

Comments
 (0)