Skip to content

Commit cdde9c2

Browse files
committed
Update products.mdx based on issue #216
1 parent c3f5256 commit cdde9c2

File tree

1 file changed

+53
-63
lines changed

1 file changed

+53
-63
lines changed

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

Lines changed: 53 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -86,85 +86,75 @@ tabs:
8686
</Step>
8787
<Step title="Add your product configuration">
8888
89-
To define a product, add an item to the `products` list in `docs.yml`, specifying the `display-name` and `path`.
89+
To define a product, add an item to the `products` list in `docs.yml`. Each product requires:
9090

91-
The optional parameters are: `image`, `icon`, `subtitle`, `slug`, and `versions`.
91+
- `display-name` - The name shown in the product selector
92+
- `path` - Path to the product's YAML configuration file
9293

93-
<Note>If you provide both an `image` and an `icon`, the `image` will take precedence.</Note>
94-
95-
The below example is a `docs.yml` configuration for a site with two products, Product A and Product B.
94+
Optional parameters:
95+
- `image` - Path to product icon image
96+
- `icon` - Font Awesome icon class (used if no image provided)
97+
- `subtitle` - Short description shown under product name
98+
- `slug` - URL-friendly identifier
99+
- `versions` - Configuration for product versions
96100

97101
<CodeBlock title="docs.yml">
98-
```yaml {2-3, 8-9}
102+
```yaml
99103
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
104+
- display-name: Data API
105+
path: ./products/data/versions/v2.yml
106+
subtitle: Integrate with Webflow
107+
icon: fa-light fa-database
108+
image: ./assets/product-selector/data-api-image.svg
109+
slug: data
110+
versions:
111+
- display-name: v2
112+
slug: v2.0.0
113+
path: ./products/data/versions/v2.yml
114+
- display-name: v2 (beta)
115+
slug: v2.0.0-beta
116+
path: ./products/data/versions/v2-beta.yml
117+
- display-name: v1 (legacy)
118+
slug: v1.0.0
119+
path: ./products/data/versions/v1.yml
111120
```
112121
</CodeBlock>
113-
</Step>
114-
<Step title="Add versioning to your products (optional)">
115122

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.
123+
<Note>If you provide both an `image` and an `icon`, the `image` will take precedence.</Note>
117124

118-
In the below example, Product A is **unversioned** and Product B is **versioned**:
125+
</Step>
126+
<Step title="Add versioning to your products (optional)">
119127

120-
<CodeBlock>
128+
Products can be versioned or unversioned. For versioned products, organize version files in a subdirectory structure:
121129

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
130+
```bash
131+
fern/
132+
└─ products/
133+
└─ data-api/
134+
├─ data-api.yml # Product config
133135
└─ versions/
134-
├─ latest/
135-
│ ├─ latest.yml
136-
│ └─ pages/...
137-
└─ v2/
138-
├─ v2.yml
139-
└─ pages/...
140-
```
141-
</CodeBlock>
136+
├─ v2/
137+
│ ├─ v2.yml # v2 config
138+
│ └─ pages/ # v2 content
139+
└─ v1/
140+
├─ v1.yml # v1 config
141+
└─ pages/ # v1 content
142+
```
142143

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:
144+
Add version configuration in `docs.yml`:
144145

145-
<CodeBlock title="docs.yml">
146-
```yaml {2, 8, 13-17}
146+
```yaml
147147
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
148+
- display-name: Data API
149+
path: ./products/data-api/versions/v2.yml # Default version
150+
versions:
151+
- display-name: v2
152+
path: ./products/data-api/versions/v2.yml
153+
- display-name: v1
154+
path: ./products/data-api/versions/v1.yml
164155
```
165-
</CodeBlock>
166156

167-
For more information on setting up versioned products, follow our [versioning docs](/docs/navigation/versions).
157+
For more details on versioning, see our [versioning guide](/docs/navigation/versions).
168158
</Step>
169159
<Step title="Remove extra navigation from docs.yml">
170160

@@ -234,4 +224,4 @@ The dropdown menus for product and version selectors can be customized using the
234224
<img src="webflow-version-selector.avif" alt="Example of a styled version selector" />
235225
</Frame>
236226
</Tab>
237-
</Tabs>
227+
</Tabs>

0 commit comments

Comments
 (0)