diff --git a/fern/products/cli-api-reference/pages/docs-commands.mdx b/fern/products/cli-api-reference/pages/docs-commands.mdx index c3e53c5e5..6e19ccbf7 100644 --- a/fern/products/cli-api-reference/pages/docs-commands.mdx +++ b/fern/products/cli-api-reference/pages/docs-commands.mdx @@ -23,6 +23,7 @@ These commands build, preview, and publish a Fern documentation site, and valida | [`fern docs theme download`](#fern-docs-theme-download) | Download a theme from Fern's registry into a local directory | | [`fern docs link check`](#fern-docs-link-check) | Check for broken links on a live documentation site | | [`fern docs theme list`](#fern-docs-theme-list) | List all themes for your organization | +| [`fern docs theme rebuild`](#fern-docs-theme-rebuild) | Rebuild sites built with an older version of a theme | | [`fern mcp install`](#fern-mcp-install) | Connect a coding agent to your organization's Fern MCP server | ## Detailed command documentation @@ -614,6 +615,44 @@ These commands build, preview, and publish a Fern documentation site, and valida + + + Use `fern docs theme rebuild` to rebuild every site in your organization that was built with an older version of a [theme](/learn/docs/customization/global-themes#updating-a-theme). Each site is rebuilt from its last publish with the latest uploaded theme, so child repositories don't need to publish again. Running it requires an organization admin. + + + ```bash + fern docs theme rebuild [--name ] [--dry-run] [--org ] + ``` + + + The command prints each site it rebuilds. Rebuilds run in the background, and each site picks up the theme when its build finishes. + + ### name + + Use `--name` to only rebuild sites using one theme. Defaults to every theme in the organization. + + ```bash + fern docs theme rebuild --name my-theme + ``` + + ### dry-run + + Use `--dry-run` to list the sites that would be rebuilt without rebuilding them. + + ```bash + fern docs theme rebuild --dry-run + ``` + + ### org + + Use `--org` to override the organization ID from `fern.config.json`. + + ```bash + fern docs theme rebuild --org my-org + ``` + + + Use `fern mcp install` to register [your organization's Fern MCP server](/learn/docs/ai-features/fern-mcp-servers) with a coding agent, giving it Fern's own documentation and configuration reference alongside your live sites, deployments, analytics, and reader activity — the same tools [Fern Agent](/learn/docs/ai-features/fern-agent) works from. diff --git a/fern/products/docs/pages/customization/global-themes.mdx b/fern/products/docs/pages/customization/global-themes.mdx index d6f973657..0f9aac0f0 100644 --- a/fern/products/docs/pages/customization/global-themes.mdx +++ b/fern/products/docs/pages/customization/global-themes.mdx @@ -124,6 +124,13 @@ fern docs theme export fern docs theme upload --name my-theme ``` +To apply the update without waiting for each child repository to publish again, run [`fern docs theme rebuild`](/learn/cli-api-reference/cli-reference/docs-commands#fern-docs-theme-rebuild). It rebuilds every site in your organization that was built with an older version of the theme, using the content from that site's last publish. Running it requires an organization admin. + +```bash +fern docs theme rebuild --name my-theme --dry-run +fern docs theme rebuild --name my-theme +``` + ## Self-hosted sites A [self-hosted](/learn/docs/self-hosted/set-up#vendor-a-global-theme) container has no access to Fern's registry, so it resolves `global-theme` from a copy of the theme vendored into the image with [`fern docs theme download`](/learn/cli-api-reference/cli-reference/docs-commands#fern-docs-theme-download). diff --git a/fern/products/home/pages/fern-instructions/docs/publish.mdx b/fern/products/home/pages/fern-instructions/docs/publish.mdx index 9b46c9299..d540bfa6f 100644 --- a/fern/products/home/pages/fern-instructions/docs/publish.mdx +++ b/fern/products/home/pages/fern-instructions/docs/publish.mdx @@ -20,6 +20,7 @@ Use this to see a change before it ships, or to ship it. - `fern generate --docs` fails on any `fern check` rule set to `error`. - In CI, set `FERN_TOKEN` and pass `--no-prompt`. See `automate`. - Don't publish to production when the user asked for a preview. +- After `fern docs theme upload`, sites using that `global-theme` keep the old theme until they publish again. `fern docs theme rebuild` rebuilds them without a publish. It needs an org admin. Run `--dry-run` first to list the sites. ## Verify