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
|[`fern docs theme export`](#fern-docs-theme-export)| Export theme-eligible fields from `docs.yml` into a standalone directory |
31
31
|[`fern docs theme upload`](#fern-docs-theme-upload)| Upload a theme to Fern's registry |
32
+
|[`fern docs link check`](#fern-docs-link-check)| Check for broken links on a live documentation site |
32
33
|[`fern docs theme list`](#fern-docs-theme-list)| List all themes for your organization |
33
34
34
35
## SDK generation commands
@@ -281,8 +282,6 @@ hideOnThisPage: true
281
282
Use `fern check` to validate your API definition and Fern configuration, including [`fern.config.json`](/learn/sdks/overview/project-structure#fernconfigjson), `generators.yml`, and `docs.yml`. It checks for broken links, invalid API examples, configuration errors, and more. When all checks pass, the command produces no output.
282
283
283
284
Most `fern check` rules — including [`broken-links`](/learn/docs/configuration/site-level-settings#check-configuration) — validate against the navigation tree built from your **local** config and do not crawl your live deployed site or follow external URLs. The exception is the [`missing-redirects` rule](/learn/docs/seo/redirects#catching-missing-redirects), which compares your local navigation against the previously published state and therefore requires `fern login` or `FERN_TOKEN`.
284
-
285
-
To check links on a published site, use the link checker in the [Fern Dashboard](https://dashboard.buildwithfern.com/) instead. When all checks pass, the command produces no output.
286
285
287
286
<CodeBlock title="terminal">
288
287
```bash
@@ -300,6 +299,10 @@ hideOnThisPage: true
300
299
missing-redirects: error
301
300
```
302
301
302
+
<Info>
303
+
To check links on a published site, use [`fern docs link check`](#fern-docs-link-check) or the link checker in the [Fern Dashboard](https://dashboard.buildwithfern.com/) instead.
304
+
</Info>
305
+
303
306
### api
304
307
305
308
Use `--api <api>` to specify which API you'd like to check.
@@ -466,6 +469,73 @@ hideOnThisPage: true
466
469
467
470
</Accordion>
468
471
472
+
<Accordion title="fern docs link check">
473
+
474
+
Use `fern docs link check` to scan a live documentation site for broken links. The command crawls the published site, checks every link, and reports broken (404) and blocked (403) URLs along with their source pages.
475
+
476
+
<CodeBlock title="terminal">
477
+
```bash
478
+
fern docs link check [--url <url>] [--output <format>]
479
+
```
480
+
</CodeBlock>
481
+
482
+
<Info>
483
+
Unlike the [`broken-links` rule](#fern-check) in `fern check`, which validates only internal links in your local YAML navigation tree, `fern docs link check` checks all links — internal and external — on your live deployed site.
484
+
</Info>
485
+
486
+
By default, the command auto-detects your docs URL from the `instances` in `docs.yml`. When all links are valid, the command exits with a success message.
487
+
488
+
The command first scrapes every page on the site, then checks each link it finds. When broken links are found, the output includes a summary and a grouped list of broken URLs with status codes and source file paths.
489
+
490
+
```plaintext
491
+
◆ Checking links on your-org.docs.buildwithfern.com...
Use `--url` to specify which docs site to check. This is useful when you have multiple instances or want to check a preview deployment.
520
+
521
+
```bash
522
+
fern docs link check --url https://your-org.docs.buildwithfern.com
523
+
```
524
+
525
+
### output
526
+
527
+
Use `--output` to control the output format. Supported values are `text` (default), `json`, and `csv`.
528
+
529
+
```bash
530
+
# JSON output for programmatic use
531
+
fern docs link check --output json
532
+
533
+
# CSV output for spreadsheets or reporting
534
+
fern docs link check --output csv
535
+
```
536
+
537
+
</Accordion>
538
+
469
539
<Accordion title="fern docs md check">
470
540
471
541
Use `fern docs md check` to validate MDX syntax across all documentation pages referenced in your navigation configuration, including `docs.yml`, versioned configuration files, and product-specific YAML files.
You can now check for broken links on your live documentation site directly from the Fern CLI with `fern docs link check`. The command scrapes every page on your published site, checks all internal and external links, and reports broken (404) and blocked (403) URLs along with the source pages where they appear.
8
+
9
+
```bash
10
+
fern docs link check --url https://buildwithfern.com/learn
11
+
fern docs link check --url https://elevenlabs.io/docs
12
+
```
13
+
14
+
This complements the existing [`broken-links` rule](/learn/docs/configuration/site-level-settings#check-configuration) in `fern check`, which validates internal links against your local YAML navigation tree. Use `fern docs link check` after publishing to catch live 404s and broken external URLs that local validation can't detect.
15
+
16
+
<Buttonintent="none"outlinedrightIcon="arrow-right"href="/learn/cli-api-reference/cli-reference/commands#fern-docs-link-check">Read the docs</Button>
Copy file name to clipboardExpand all lines: fern/products/docs/pages/component-library/writing-content/markdown-basics.mdx
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,14 @@ In [versioned docs](/learn/docs/configuration/versions), the same path lands on
74
74
75
75
### Validating links
76
76
77
-
The [`broken-links` rule](/learn/docs/configuration/site-level-settings#check-configuration) — run by [`fern check`](/learn/cli-api-reference/cli-reference/commands#fern-check), including during `fern docs dev` — validates each internal link against the navigation tree built from your **local** YAML. It does not crawl your deployed site or follow external URLs. To check links on a published site, use the [Fern Dashboard](https://dashboard.buildwithfern.com/).
77
+
Fern provides two ways to catch broken links. The [`broken-links` rule](/learn/docs/configuration/site-level-settings#check-configuration) — run by [`fern check`](/learn/cli-api-reference/cli-reference/commands#fern-check), including during `fern docs dev` — validates each internal link against the navigation tree built from your **local** YAML. To check links on a published site, use [`fern docs link check`](/learn/cli-api-reference/cli-reference/commands#fern-docs-link-check) or the [Fern Dashboard](https://dashboard.buildwithfern.com/).
0 commit comments