Skip to content

Commit 19bf8eb

Browse files
committed
more organizational edits, snippets
1 parent 7b9c73d commit 19bf8eb

File tree

4 files changed

+53
-23
lines changed

4 files changed

+53
-23
lines changed

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

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Product Switching
2+
title: Product switching
33
subtitle: Allow users to seamlessly navigate between different products you offer.
44
---
55

@@ -24,7 +24,7 @@ subtitle: Allow users to seamlessly navigate between different products you offe
2424

2525
Each product can contain its own distinct versions, tabs, sections, pages, and API references. Products can share content as well.
2626

27-
## Add Products to Your Docs
27+
## Add products to your docs
2828

2929
<Steps toc={true}>
3030
<Step title="Define your products">
@@ -104,7 +104,7 @@ products:
104104
subtitle: Product A subtitle # optional
105105
106106
- display-name: Product B
107-
path: ./products/product-b/latest.yml # <-- default showing latest
107+
path: ./products/product-b/versions/latest/latest.yml # <-- default showing latest
108108
image: ./images/product-b.png # optional
109109
slug: product-b # optional
110110
subtitle: Product B subtitle # optional
@@ -119,7 +119,9 @@ If your `docs.yml` file includes a `navigation` field or a `tabs` field, be sure
119119

120120
### Add versioning to your products (optional)
121121

122-
Once you've defined your products, you can optionally add versions. Versioned and unversioned products can live next to each other in your site.
122+
You can optionally add versions to your products. Versioned and unversioned products can live next to each other in your site.
123+
124+
<Note>For standalone versioning without products, see our [Versioning guide](/docs/configuration/versions).</Note>
123125

124126
In the below example, Product A is **unversioned** and Product B is **versioned**:
125127

@@ -148,6 +150,8 @@ In the below example, Product A is **unversioned** and Product B is **versioned*
148150

149151
<Steps>
150152
<Step title="Define your versions">
153+
Create a `versions` folder inside of folder of the product you want to version.
154+
151155
Each version of a single product has its own `yml` file. 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.
152156

153157
Version-specific `yml` files:
@@ -170,15 +174,15 @@ products:
170174
slug: product-a # optional
171175
subtitle: Product A subtitle # optional
172176
- display-name: Product B # versioned
173-
path: ./products/product-b/latest.yml # <-- default showing latest
177+
path: ./products/product-b/versions/latest/latest.yml # <-- default showing latest
174178
image: ./images/product-b.png # optional
175179
slug: product-b # optional
176180
subtitle: Product B subtitle # optional
177181
versions:
178182
- display-name: Latest
179-
path: ./products/product-b/latest.yml # relative path to the version file
183+
path: ./products/product-b/versions/latest/latest.yml # relative path to the version file
180184
- display-name: V2
181-
path: ./products/product-b/v2.yml # relative path to the version file
185+
path: ./products/product-b/versions/v2/v2.yml # relative path to the version file
182186
```
183187
</CodeBlock>
184188

@@ -191,21 +195,22 @@ products:
191195
```yaml {4}
192196
versions:
193197
- display-name: Latest
194-
path: ./products/product-b/latest.yml
198+
path: ./products/product-b/versions/latest/latest.yml
195199
availability: beta
196200
- display-name: V2
197-
path: ./products/product-b/v2.yml
201+
path: ./products/product-b/versions/v2/v2.yml
198202
availability: stable
199203
```
200204
</CodeBlock>
201205
</Step>
202-
<Step title="Remove extra navigation from docs.yml">
203-
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.
206+
<Step title="Remove extra navigation">
207+
208+
If your product-specific `.yml` files for **versioned products** includes a `navigation` field or a `tabs` field, be sure to remove. Those fields should now belong in the version-specific `.yml` files.
204209
</Step>
205210
</Steps>
206211

207212

208-
## Customizing Selector Styling
213+
## Customize selector styling
209214

210215
You can directly customize the appearance of the product and version selectors by targeting their CSS classes:
211216

@@ -216,13 +221,9 @@ You can directly customize the appearance of the product and version selectors b
216221
<img src="webflow-dropdown-selector.avif" alt="Example of a styled product selector" />
217222
</Frame>
218223

219-
### Common Styling Adjustments
220-
221-
**Adjusting positioning:**
222-
Use `transform: translateY(Npx)` to adjust the vertical positioning of the selectors. This ensures that the product and version selectors match the line height of your logo for better visual alignment.
224+
### Common styling adjustments
223225

224-
**Enhancing visual prominence:**
225-
You can modify the border radius and add borders to make the selectors more prominent and better integrated with your site's design aesthetic.
226+
<Markdown src="/snippets/common-selector-styling.mdx" />
226227

227228
```css
228229
.fern-product-selector {
@@ -238,7 +239,7 @@ You can modify the border radius and add borders to make the selectors more prom
238239
}
239240
```
240241

241-
## Customizing Dropdown Styling
242+
### Customize dropdown styling
242243

243244
The dropdown menus for product and version selectors can be customized using these specific CSS classes:
244245

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

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ subtitle: Allow users to navigate between different versions of your docs.
99

1010
Each version of your docs can contain its own distinct tabs, sections, pages, and API references. Versions can share content, as well.
1111

12-
**To add versions to your docs:**
12+
## Add versions to your docs
1313

1414
<Steps toc={true}>
1515
<Step title="Define your versions">
@@ -73,4 +73,28 @@ versions:
7373
7474
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.
7575
</Step>
76-
</Steps>
76+
</Steps>
77+
78+
## Customize version selector styling
79+
80+
You can directly customize the appearance of the version selector by targeting the `fern-version-selector` CSS class.
81+
82+
### Common styling adjustments
83+
84+
<Markdown src="/snippets/common-selector-styling.mdx" />
85+
86+
```css
87+
.fern-version-selector {
88+
transform: translateY(1px);
89+
border-radius: 1000px;
90+
border: 1px solid var(--border);
91+
}
92+
```
93+
94+
### Customize the dropdown
95+
96+
The dropdown menu for the version selector can be customized using the `fern-version-selector-radio-group` CSS class.
97+
98+
<Frame>
99+
<img src="webflow-version-selector.avif" alt="Example of a styled version selector" />
100+
</Frame>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**Adjusting positioning:**
2+
Use `transform: translateY(Npx)` to adjust the vertical positioning of the selectors. This ensures that the selectors match the line height of your logo for better visual alignment.
3+
4+
**Enhancing visual prominence:**
5+
You can modify the border radius and add borders to make the selectors more prominent and better integrated with your site's design aesthetic.

fern/snippets/version-specific-yml-files.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<CodeBlocks>
2-
<CodeBlock title="versions/latest.yml">
2+
<CodeBlock title="latest.yml">
33
```yaml
44
navigation:
55
- section: Introduction
@@ -11,7 +11,7 @@ navigation:
1111
- api: API Reference
1212
```
1313
</CodeBlock>
14-
<CodeBlock title="versions/v2.yml">
14+
<CodeBlock title="v2.yml">
1515
```yaml
1616
tabs:
1717
api:

0 commit comments

Comments
 (0)