-
Notifications
You must be signed in to change notification settings - Fork 7
docs: add custom header and footer component documentation #3478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2c72e2a
ec189d5
68377ec
bd40357
678339c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| ## Server-side rendered custom header and footer | ||
|
|
||
| Replace Fern's default header or footer with your own React components using the new `header` and `footer` properties in `docs.yml`. | ||
|
|
||
| ```yaml docs.yml | ||
| header: ./components/CustomHeader.tsx | ||
| footer: ./components/CustomFooter.tsx | ||
| ``` | ||
|
|
||
| Components are server-side rendered for better SEO and performance, with no layout shifts during page load. | ||
|
|
||
| Learn more about [custom header and footer components](/learn/docs/writing-content/custom-react-components#custom-header-and-footer). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,6 +111,14 @@ navbar-links: | |
| [`metadata` configuration](/learn/docs/getting-started/global-configuration#seo-metadata-configuration). | ||
| </ParamField> | ||
|
|
||
| <ParamField path="header" type="string" required={false} toc={true}> | ||
| Path to a custom React component file (TSX or JSX) to replace Fern's default header. The component must have a default export. Learn more about [custom header and footer components](/learn/docs/writing-content/custom-react-components#custom-header-and-footer). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [vale] reported by reviewdog 🐶 |
||
| </ParamField> | ||
|
|
||
| <ParamField path="footer" type="string" required={false} toc={true}> | ||
| Path to a custom React component file (TSX or JSX) to replace Fern's default footer. The component must have a default export. Learn more about [custom header and footer components](/learn/docs/writing-content/custom-react-components#custom-header-and-footer). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [vale] reported by reviewdog 🐶 |
||
| </ParamField> | ||
|
|
||
| ## Instances configuration | ||
|
|
||
| An `instance` is the backend of a distinct docs website. Each instance is published to a unique domain using the `--instance` flag. It is most common to use instances to configure staging and production docs which publish to separate URLs. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [vale] reported by reviewdog 🐶
[FernStyles.Headings] 'Custom components in MDX' should use sentence-style capitalization.