Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,20 +289,20 @@ redirects:
destination: /learn/sdks/overview/introduction
- source: /learn/sdks/introduction/customer-showcase
destination: /learn/sdks/overview/introduction
- source: /learn/sdks/introduction/changelog/ts/:slug*
destination: /learn/sdks/generators/typescript/changelog/:slug*
- source: /learn/sdks/introduction/changelog/python/:slug*
destination: /learn/sdks/generators/python/changelog/:slug*
- source: /learn/sdks/introduction/changelog/csharp/:slug*
destination: /learn/sdks/generators/csharp/changelog/:slug*
- source: /learn/sdks/introduction/changelog/go/:slug*
destination: /learn/sdks/generators/go/changelog/:slug*
- source: /learn/sdks/introduction/changelog/java/:slug*
destination: /learn/sdks/generators/java/changelog/:slug*
- source: /learn/sdks/introduction/changelog/ruby/:slug*
destination: /learn/sdks/generators/ruby/changelog/:slug*
- source: /learn/sdks/introduction/changelog/php/:slug*
destination: /learn/sdks/generators/php/changelog/:slug*
- source: /learn/sdks/introduction/changelog/ts/:slug(.*)
destination: /learn/sdks/generators/typescript/changelog/:slug(.*)
- source: /learn/sdks/introduction/changelog/python/:slug(.*)
destination: /learn/sdks/generators/python/changelog/:slug(.*)
- source: /learn/sdks/introduction/changelog/csharp/:slug(.*)
destination: /learn/sdks/generators/csharp/changelog/:slug(.*)
- source: /learn/sdks/introduction/changelog/go/:slug(.*)
destination: /learn/sdks/generators/go/changelog/:slug(.*)
- source: /learn/sdks/introduction/changelog/java/:slug(.*)
destination: /learn/sdks/generators/java/changelog/:slug(.*)
- source: /learn/sdks/introduction/changelog/ruby/:slug(.*)
destination: /learn/sdks/generators/ruby/changelog/:slug(.*)
- source: /learn/sdks/introduction/changelog/php/:slug(.*)
destination: /learn/sdks/generators/php/changelog/:slug(.*)

# SDK overview (renamed pages)
- source: /learn/sdks/overview/set-up-the-fern-folder
Expand Down Expand Up @@ -699,6 +699,8 @@ redirects:
destination: /learn/api-definitions/grpc/:slug*
- source: /learn/api-definitions/protobuf
destination: /learn/api-definitions/grpc/overview
- source: /learn/api-definitions/protobuf/:slug*
destination: /learn/api-definitions/grpc/:slug*

# FernDef (specifics before catchall — comparison-with-open-api was shadowed)
- source: /learn/api-definition/fern/comparison-with-open-api
Expand Down
2 changes: 2 additions & 0 deletions fern/products/docs/pages/navigation/tabs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ theme:
```
</CodeBlock>

The object form (`style`, `alignment`, `placement`) requires Fern CLI 4.44.0 or later. The string shorthand (`theme.tabs: default` or `theme.tabs: bubble`) works on all versions.

### Tab properties

<ParamField path="display-name" type="string" required={true} toc={true}>
Expand Down
19 changes: 18 additions & 1 deletion fern/products/docs/pages/seo/redirects.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Configure redirects
subtitle: Learn how to configure redirects in Fern Docs. Set up exact path redirects and regex patterns to preserve SEO equity when pages move.
subtitle: Learn how to configure redirects in Fern Docs. Set up exact path redirects and regex patterns to preserve SEO equity when pages move or when you migrate to a new custom domain.
---

Redirects map old URLs to new ones so inbound links and search rankings survive when pages move, change slugs, or are deleted. They apply to [Markdown URLs](/learn/docs/ai-features/markdown) too: a redirected page's `.md` or `.mdx` twin returns a `308` to the destination's twin.
Expand Down Expand Up @@ -113,6 +113,23 @@ redirects:

Overriding the default versioning behavior manually can lead to unexpected redirect patterns. If you frequently need to redirect from the default version to another version, change which version is set as default in your versions configuration.

## Moving to a new custom domain

The `redirects` configuration in `docs.yml` is **path-based only**. The `source` property must be a relative path, not an absolute URL, so you cannot redirect one domain to another with a `redirects` entry.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'can't' instead of 'cannot'.


To forward traffic from an old custom domain to a new one, handle it at the DNS or reverse-proxy layer (Cloudflare, AWS CloudFront, Nginx, and similar), or contact Fern to register the old domain as an additional alias on the site — see [Multiple custom domains](/learn/docs/preview-publish/setting-up-your-domain#multiple-custom-domains).

Use `redirects` for the complementary case: when paths change *within* the new domain. If the URL structure shifted during the move, map the old paths to the new ones with pattern redirects. Remember to include the subpath in both `source` and `destination` if the site is hosted on one.

<CodeBlock title="docs.yml">
```yaml
redirects:
# Map old path structure to new one after a domain migration
- source: "/learn/old-section/:slug(.*)"
destination: "/learn/new-section/:slug(.*)"
```
</CodeBlock>

## Catching missing redirects

The [`missing-redirects` rule](/learn/docs/configuration/site-level-settings#check-configuration), run by [`fern check`](/learn/cli-api-reference/cli-reference/commands#fern-check), compares the navigation tree built from your local YAML against the most recently **published** state of your site and flags previously published URLs that no longer resolve and aren't covered by an entry in `redirects:`. This catches pages you've moved or removed before they start returning 404s for existing inbound links. Tune its severity in `docs.yml`.
Expand Down
16 changes: 16 additions & 0 deletions fern/products/sdks/generators/python/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,22 @@ Allow specifying arbitrary configuration to your packages `pyproject.toml` by ad
```
</ParamField>

## License

The `fern-python-sdk` generator has no dedicated `license` config key, unlike the Java generator's `metadata.license`. Set the license by injecting it into the generated `pyproject.toml` via the [`pyproject_toml`](#pyproject_toml) config option, whose contents are added as-is:

```yaml title="generators.yml"
groups:
python-sdk:
generators:
- name: fern-python-sdk
version: 5.27.1
config:
pyproject_toml: |
[tool.poetry]
license = "MIT"
```

<ParamField path="runtime_version" type="bool" default="false" required={false} toc={true}>
When enabled, the generated SDK resolves the version it reports in the `X-Fern-SDK-Version` header and the [structured `User-Agent`](#include_platform_headers) version segment at runtime with `importlib.metadata.version()`, instead of the version baked in at generation time. Enable this when external release tooling determines the published version after generation, so the reported version always matches the installed package. The generation-time version is used as a fallback when the distribution isn't installed. If [`omit_fern_headers`](#omit_fern_headers) is enabled, the SDK reports no version at all and this option has no effect.
</ParamField>
Expand Down
Loading