Add Custom Content to Your Docs
Generated Content
Most of the content of an SDK docs site is fully generated from the OpenAPI spec.
To modify anything that appears under the resources section of docs, you need to edit your spec and regenerate. Some customizations you can make directly in your docs directory and they will not be overwritten – these are detailed below.
Customize SDK Guides
The guides section of SDK docs features several different pieces of content that you can disable or override.
These are the guides that are available, depending on your OpenAPI spec and the gen.yaml
configurations to disable them.
For more information on configuring your gen.yaml
file, see gen.yaml reference.
Guide | Disable Config |
---|---|
Installation | disableInstallationSection |
Pagination | disablePaginationSection |
Global Parameters | disableGlobalParametersSection |
Custom Http Client | disableCustomClientSection |
Security Options | disableSecurityOptionsSection |
SDK Errors | disableSDKErrorsSection |
Retries | disableRetriesSection |
Server Options | disableServerOptionsSection |
You can also manually override the content for each of these sections. Navigate to /content/pages/01-reference/{language}/{guide}/_snippet.mdx
to edit sections.
Following generation, you should see code that looks like the following.
Remove the markdown comments and replace this file with your custom content. The docs generator will not overwrite this custom content.
Add a Navbar Link
Speakeasy supports adding custom navlinks at the top of your SDK docs site that you can use to link out to other parts of your website.
To configure custom navlinks, add some basic extra configuration to your theme.yaml
file.
Set Up Custom Redirects
You may want to set up current custom redirect patterns, for example, if you're migrating from an old docs site to your new SDK docs.
Set up custom redirect patterns in the theme.yaml
file.
Speakeasy supports both absolute paths and wildcard paths at the middle and end of the URL.