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
+42-21Lines changed: 42 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,15 +32,15 @@ Each product can contain its own distinct versions, tabs, sections, pages, and A
32
32
Create a `products` folder inside of your `fern` folder. To specify a product's contents and navigational structure, add a `.yml` file to the `products` folder for each product.
33
33
Make sure to include the `navigation` and `tabs` properties, if applicable.
34
34
35
-
```bash
35
+
```bash {4, 7-8}
36
36
fern/
37
37
├─ fern.config.json
38
38
├─ generators.yml
39
-
├─ docs.yml
39
+
├─ docs.yml# Site-level contents and navigation
40
40
└─ products/
41
41
├─ ...
42
-
├─ product-a.yml
43
-
└─ product-b.yml
42
+
├─ product-a.yml# Contents and navigation for Product A
43
+
└─ product-b.yml# Contents and navigation for Product B
44
44
```
45
45
46
46
<CodeBlocks>
@@ -92,10 +92,34 @@ The optional parameters are: `image`, `icon`, `subtitle`, `slug`, and `versions`
92
92
93
93
<Note>If you provide both an `image` and an `icon`, the `image` will take precedence.</Note>
94
94
95
-
<Accordion title='Setting up Versioned Products'>
96
-
Products can be versioned or unversioned. The following is an example of how more complex products might be organized:
95
+
The below example is a `docs.yml` configuration for a site with two products, Product A and Product B.
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}
99
123
fern/
100
124
├─ fern.config.json
101
125
├─ generators.yml
@@ -104,35 +128,30 @@ The optional parameters are: `image`, `icon`, `subtitle`, `slug`, and `versions`
104
128
├─ ...
105
129
└─ products/
106
130
├── product-a.yml # basic unversioned product
107
-
├── product-b/ # unversioned product with product-specific pages
108
-
│ ├─ pages/...
109
-
│ └─ product-with-pages.yml
110
-
└── product-c/ # versioned product
111
-
├─ product-c.yml
131
+
└── product-b/ # versioned product
132
+
├─ product-b.yml
112
133
└─ versions/
113
-
├─ v1/
114
-
│ ├─ v1.yml
134
+
├─ latest/
135
+
│ ├─ latest.yml
115
136
│ └─ pages/...
116
137
└─ v2/
117
138
├─ v2.yml
118
139
└─ pages/...
119
140
```
141
+
</CodeBlock>
120
142
121
-
For more information on setting up versions, follow our [versioning docs](/learn/docs/building-and-customizing-your-docs/versioning).
122
-
</Accordion>
123
-
124
-
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:
For more information on setting up versioned products, follow our [versioning docs](/docs/navigation/versions).
168
+
148
169
### Remove extra `navigation` from `docs.yml`
149
170
If your `docs.yml` file includes a `navigation` field or a `tabs` field, be sure to remove. Those fields should now belong in the product-specific `.yml` files.
Copy file name to clipboardExpand all lines: fern/products/docs/pages/navigation/versions.mdx
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,10 @@ Each version of your docs can contain its own distinct tabs, sections, pages, an
14
14
<Steps>
15
15
### Define your versions
16
16
17
-
Create a `versions` folder inside of your `fern` folder. 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.
17
+
Create a `versions` folder inside of your `fern` folder. 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.
18
18
19
-
```bash
19
+
<CodeBlock>
20
+
```bash {7-11}
20
21
fern/
21
22
├─ fern.config.json
22
23
├─ generators.yml
@@ -29,6 +30,10 @@ fern/
29
30
├─ v2-2/pages/...
30
31
└─ v2-2.yml
31
32
```
33
+
</CodeBlock>
34
+
35
+
36
+
Version-specific `yml` files:
32
37
33
38
<CodeBlocks>
34
39
<CodeBlocktitle="versions/v2-1.yml">
@@ -73,6 +78,8 @@ tabs:
73
78
</CodeBlock>
74
79
</CodeBlocks>
75
80
81
+
<Note>You can also have multiple products, some versioned and some unversioned. For more information on setting up multiple products, follow our [product switching docs](/docs/navigation/products).</Note>
82
+
76
83
### Add your version configuration
77
84
78
85
To define a version, in `docs.yml`, add an item to the `versions` list, specifying the `display-name` and `path`.
0 commit comments