Skip to content

Commit 3ee940d

Browse files
Kapil GowruKapil Gowru
authored andcommitted
feat: added redirects for most of sdk pages
1 parent 8fcb2c1 commit 3ee940d

File tree

22 files changed

+265
-196
lines changed

22 files changed

+265
-196
lines changed

fern/assets/styles.css

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,152 @@
212212

213213
/*** END -- PRODUCT SELECTOR STYLING ***/
214214

215+
/*** START -- DOCS HOMEPAGE STYLING ***/
216+
.docs-homepage {
217+
position: relative;
218+
.fern-card {
219+
text-decoration: none !important;
220+
}
221+
222+
223+
.dashed-pattern-left {
224+
position: absolute;
225+
left: -4rem;
226+
top: -8.5rem;
227+
height: calc(100% + 26rem);
228+
width: 1rem;
229+
opacity: 1;
230+
pointer-events: none;
231+
border-right: 1px solid var(--grayscale-5);
232+
mask: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0 ) 100%);
233+
-webkit-mask: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0) 100%);
234+
}
235+
236+
.dashed-pattern-right {
237+
position: absolute;
238+
right: -4rem;
239+
top: -8.5rem;
240+
height: calc(100% + 26rem);
241+
width: 1rem;
242+
opacity: 1;
243+
pointer-events: none;
244+
border-left: 1px solid var(--grayscale-5);
245+
mask: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0) 100%);
246+
-webkit-mask: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0) 100%);
247+
}
248+
249+
250+
.fern-card {
251+
border: none !important;
252+
padding: 0 !important;
253+
box-shadow: none !important;
254+
background-color: transparent !important;
255+
256+
.card-title {
257+
display: flex;
258+
gap: 0.25rem;
259+
align-items: center;
260+
}
261+
262+
img {
263+
transition: transform 0.15s ease-in-out;
264+
}
265+
266+
.arrow-right {
267+
height: 1rem;
268+
opacity: 0;
269+
transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
270+
transform: translateX(0px);
271+
}
272+
273+
&:hover {
274+
img {
275+
transform: scale(1.01);
276+
}
277+
278+
.arrow-right {
279+
opacity: 1;
280+
transform: translateX(2px);
281+
}
282+
}
283+
}
284+
}
285+
/*** END -- DOCS HOMEPAGE STYLING ***/
286+
287+
/*** START -- SDKS HOMEPAGE STYLING ***/
288+
.sdks-homepage {
289+
position: relative;
290+
291+
.fern-card {
292+
text-decoration: none !important;
293+
}
294+
295+
.dashed-pattern-left {
296+
position: absolute;
297+
left: -4rem;
298+
top: -8.5rem;
299+
height: calc(100% + 26rem);
300+
width: 1rem;
301+
opacity: 1;
302+
pointer-events: none;
303+
border-right: 1px solid var(--grayscale-5);
304+
mask: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0 ) 100%);
305+
-webkit-mask: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0) 100%);
306+
}
307+
308+
.dashed-pattern-right {
309+
position: absolute;
310+
right: -4rem;
311+
top: -8.5rem;
312+
height: calc(100% + 26rem);
313+
width: 1rem;
314+
opacity: 1;
315+
pointer-events: none;
316+
border-left: 1px solid var(--grayscale-5);
317+
mask: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0) 100%);
318+
-webkit-mask: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0) 100%);
319+
}
320+
321+
.fern-card {
322+
border: none !important;
323+
padding: 0 !important;
324+
box-shadow: none !important;
325+
background-color: transparent !important;
326+
327+
.external-link-icon {
328+
display: none !important;
329+
}
330+
331+
.card-title {
332+
display: flex;
333+
gap: 0.25rem;
334+
align-items: center;
335+
}
336+
337+
img {
338+
transition: transform 0.15s ease-in-out;
339+
}
340+
341+
.arrow-right {
342+
height: 1rem;
343+
opacity: 0;
344+
transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
345+
transform: translateX(0px);
346+
}
347+
348+
&:hover {
349+
img {
350+
transform: scale(1.01);
351+
}
352+
353+
.arrow-right {
354+
opacity: 1;
355+
transform: translateX(2px);
356+
}
357+
}
358+
}
359+
}
360+
/*** START -- SDKS HOMEPAGE STYLING ***/
215361

216362
/*** START -- LANDING PAGE STYLING ***/
217363
:is(.dark) {

fern/docs.yml

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ products:
2727

2828
- display-name: Ask Fern
2929
path: ./products/ask-fern/ask-fern.yml
30-
icon: fa-regular fa-magnifying-glass
30+
icon: fa-regular fa-magnifying-glass
3131
image: ./images/product-switcher/product-switcher-askfern-light.png
3232
slug: ask-fern
3333
subtitle: Let users find answers in your documentation instantly
@@ -150,26 +150,62 @@ analytics:
150150
# Redirects for new docs structure migration
151151
redirects:
152152
- source: /learn/welcome
153-
destination: /learn
153+
destination: /learn/home
154154
permanent: true
155-
- source: /learn/home
156-
destination: /learn
155+
- source: /learn
156+
destination: /learn/home
157157
permanent: true
158158
- source: /learn/api-definition/fern/api-yml-reference
159159
destination: /learn/api-definition/fern/api-yml/overview
160160
permanent: true
161+
- source: /learn/docs/api-references/api-explorer
162+
destination: /learn/docs/api-references/api-explorer/overview
161163
- source: /learn/docs/api-references/api-playground/:slug*
162-
destination: /learn/docs/api-references/api-explorer/:slug*
164+
destination: learn/docs/api-references/api-explorer/:slug*
163165
permanent: true
164166
- source: /learn/docs/api-references/api-playground
165-
destination: /learn/docs/api-references/api-explorer
167+
destination: /learn/docs/api-references/api-explorer/overview
166168
permanent: true
167169
- source: /learn/sdks/features/:slug*
168170
destination: /learn/sdks/capabilities/:slug*
169171
permanent: true
172+
- source: /learn/sdks/capabilities/method-names
173+
destination: /learn/sdks/deep-dives/customize-method-names
174+
permanent: true
175+
- source: /learn/sdks/guides/preview-your-sdk-locally
176+
destination: /learn/sdks/deep-dives/setup-local-sdk-previews
177+
permanent: true
178+
- source: /learn/sdks/capabilities/auto-pagination
179+
destination: /learn/v2/sdks/deep-dives/configure-auto-pagination
180+
permanent: true
181+
- source: /learn/sdks/capabilities/idempotency-headers
182+
destination: /learn/sdks/deep-dives/configure-idempotency
183+
permanent: true
170184
- source: /learn/sdks/package-managers/:slug*
171185
destination: /learn/sdks/guides/publish-to-package-managers/:slug*
172186
permanent: true
187+
- source: /learn/sdks/guides/publish-to-package-managers/npm-type-script
188+
destination: /learn/sdks/generators/type-script/publishing-to-npm
189+
permanent: true
190+
- source: /learn/sdks/guides/publish-to-package-managers/pypi
191+
destination: /learn/sdks/generators/python/publishing-to-py-pi
192+
permanent: true
193+
- source: /learn/sdks/guides/publish-to-package-managers/nuget
194+
destination: /learn/sdks/generators/net/publishing-to-nu-get
195+
permanent: true
196+
- source: /learn/sdks/guides/publish-to-package-managers/pkgsite
197+
destination: /learn/sdks/generators/go/publishing-as-a-go-module
198+
permanent: true
199+
- source: /learn/sdks/guides/publish-to-package-managers/maven-central
200+
destination: /learn/sdks/generators/java/publishing-to-maven-central
201+
permanent: true
202+
- source: /learn/sdks/guides/publish-to-package-managers/rubygems
203+
destination: /learn/sdks/generators/ruby/publishing-to-rubygems
204+
permanent: true
205+
- source: /learn/sdks/guides/publish-to-package-managers/packagist
206+
destination: /learn/sdks/generators/php/publishing-to-packagist
207+
permanent: true
208+
# PAUSED HERE
173209
- source: /learn/sdks/introduction/configuration
174210
destination: /learn/sdks/introduction/language-support
175211
permanent: true
-2.99 KB
Loading
-2.27 KB
Loading
-3.04 KB
Loading
-2.3 KB
Loading

fern/products/api-definition/api-definition.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ navigation:
6060
- page: Overlay Customizations
6161
icon: fa-regular fa-shuffle
6262
path: ./pages/openapi/overrides.mdx
63-
- page: Automatic Updates
63+
- page: Sync your OpenAPI Specification
6464
icon: fa-regular fa-arrows-rotate
6565
path: ./pages/openapi/automation.mdx
6666
- section: Integrate your Server Framework
@@ -150,4 +150,4 @@ navigation:
150150
- page: Export to OpenAPI
151151
icon: fa-regular fa-file-export
152152
slug: export-openapi
153-
path: ./pages/fern-definition/export-openapi.mdx
153+
path: ./pages/fern-definition/export-openapi.mdx

fern/products/api-definition/pages/fern-definition/endpoints/bytes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ service:
2929
## Receiving bytes
3030
3131
<Note>
32-
When handling binary data in responses, use `type: file` instead of `type: bytes`. The `bytes` type is only supported in requests.
32+
When handling binary data in responses, use `type: file` instead of `type: bytes`.
3333
</Note>
3434

3535
On the other hand, if your API is returning a stream of bytes, then you can leverage the `bytes` type as a response.
Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,54 @@
11
---
2-
title: Automatically Update
2+
title: Sync your OpenAPI Specification
33
subtitle: Pull your latest OpenAPI Specification into your Fern Folder automatically.
44
---
55

6-
If you host your OpenAPI Specification at a publically available URL, you can have Fern programmatically fetch the latest spec on a preconfigured cadence. By default, this will be done every day and open a new PR on the GitHub repo that contains your Fern Folder. This feature requires installation of the [Fern GitHub App](https://github.com/apps/fern-api).
7-
8-
```yml title="generators.yml"
9-
api:
10-
path: openapi/openapi.json
11-
origin: https://example.com/openapi.json
6+
If you host your OpenAPI Specification at a publicly available URL, you can have Fern programmatically fetch the latest spec on a preconfigured cadence through the [sync-openapi GitHub Action](https://github.com/fern-api/sync-openapi). This ensures your committed OpenAPI spec stays up to date with your live API.
7+
## Setup
8+
<Steps>
9+
<Step title="Configure the origin URL">
10+
Add the origin field to your generators.yml to specify where your OpenAPI spec is hosted:
11+
```yml title="generators.yml"
12+
api:
13+
path: openapi/openapi.json
14+
origin: https://api.example.com/openapi.json
15+
```
16+
</Step>
17+
<Step title="Add the GitHub Action">
18+
Create `.github/workflows/sync-openapi.yml` in your repository:
19+
```yml
20+
name: Sync OpenAPI Specs # can be customized
21+
on: # additional custom triggers can be configured
22+
workflow_dispatch: # manual dispatch
23+
push:
24+
branches:
25+
- main # on push to main
26+
schedule:
27+
- cron: '0 3 * * *' # everyday at 3:00 AM UTC
28+
jobs:
29+
update-from-source:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
token: ${{ secrets.OPENAPI_SYNC_TOKEN }}
35+
- name: Update API with Fern
36+
uses: fern-api/sync-openapi@v2
37+
with:
38+
update_from_source: true
39+
token: ${{ secrets.OPENAPI_SYNC_TOKEN }}
40+
branch: 'update-api'
41+
auto_merge: false
42+
add_timestamp: true
1243
```
44+
</Step>
45+
<Step title="Add a GitHub token">
46+
Generate a [fine-grained personal access token](https://github.com/settings/personal-access-tokens) with read/write access to your repository.
47+
</Step>
48+
<Step title="Add to Repository Secrets">
49+
Navigate to your repository's `Settings > Secrets and variables > Actions`. Select **New repository secret**, name it `OPENAPI_SYNC_TOKEN`, add your token, and click **Add secret**.
50+
</Step>
51+
</Steps>
52+
By default, this will create daily PRs with API spec updates to the repo containing your Fern folder. If you would like to adjust the frequency, learn more about GitHub's [schedule event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule).
53+
54+
<Info> For detailed configuration options and other use cases, see the [sync-openapi GitHub Action README](https://github.com/fern-api/sync-openapi). </Info>

fern/products/cli-api-reference/pages/snippets-api-intro.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Fern maintains official API clients for Node.js and Python. We recommend using t
2020

2121
<Cards>
2222
<Card
23-
title="Node/Typescript"
23+
title="Node/TypeScript"
2424
icon="brands node"
2525
href="https://github.com/fern-api/node-sdk"
2626
/>

0 commit comments

Comments
 (0)