Skip to content

Commit 7bac623

Browse files
authored
Merge pull request #7 from fern-api/devin/1777573883-multi-source-example
Add multi-source docs example
2 parents 33645d8 + 38d5a8c commit 7bac623

44 files changed

Lines changed: 782 additions & 3 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
project: [docs-starter, i18n, versioning]
15+
project: [docs-starter, i18n, multi-source/homepage, multi-source/seeds, multi-source/seeds-sunflower, multi-source/seeds-tomato, multi-source/greenhouses, multi-source/nursery, versioning]
1616
steps:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4

.github/workflows/preview-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
project: [docs-starter, i18n, versioning]
14+
project: [docs-starter, i18n, multi-source/homepage, multi-source/seeds, multi-source/seeds-sunflower, multi-source/seeds-tomato, multi-source/greenhouses, multi-source/nursery, versioning]
1515
steps:
1616
- name: Checkout repository
1717
uses: actions/checkout@v4

.github/workflows/publish-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
project: [docs-starter, i18n, versioning]
15+
project: [docs-starter, i18n, multi-source/homepage, multi-source/seeds, multi-source/seeds-sunflower, multi-source/seeds-tomato, multi-source/greenhouses, multi-source/nursery, versioning]
1616
steps:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Example Fern docs projects. Each top-level folder is a self-contained example wi
1010
| --- | --- | --- |
1111
| [`docs-starter`](./docs-starter) | Minimal starter project | [docs-starter.docs.buildwithfern.com](https://docs-starter.docs.buildwithfern.com) |
1212
| [`i18n`](./i18n) | Multi-language docs with English + Japanese translations | [i18n.docs.buildwithfern.com](https://i18n.docs.buildwithfern.com) |
13+
| [`multi-source`](./multi-source) | Multi-source docs — six independent projects publishing to one domain with global theme, nested sub-paths, and shared branding | [multi-source.docs.buildwithfern.com](https://multi-source.docs.buildwithfern.com) |
1314
| [`versioning`](./docs-versioned) | Versioned site with a version dropdown and a shared page | [versioning.docs.buildwithfern.com](https://versioning.docs.buildwithfern.com) |
1415

1516
## Use an example
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# yaml-language-server: $schema=https://schema.buildwithfern.dev/docs-yml.json
2+
3+
global-theme: plantstore-theme
4+
5+
instances:
6+
- url: multi-source.docs.buildwithfern.com/greenhouses
7+
multi-source: true
8+
9+
title: Greenhouses
10+
11+
navbar-links:
12+
- type: minimal
13+
text: Home
14+
href: /
15+
16+
navigation:
17+
- section: Theming
18+
contents:
19+
- page: Unified theming
20+
path: ./pages/overview.mdx
21+
- page: Theme configuration
22+
path: ./pages/climate-control.mdx
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"organization": "fern-docs-examples",
3+
"version": "5.3.0"
4+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: Theme configuration
3+
subtitle: The full theme.yml that powers this site.
4+
---
5+
6+
When you run `fern docs theme export`, the CLI extracts theme-eligible fields from your `docs.yml` into a `theme.yml` file. Here's the complete theme used by all six sites on this domain.
7+
8+
## theme.yml
9+
10+
```yaml
11+
colors:
12+
accent-primary:
13+
dark: '#70E155'
14+
light: '#1B4332'
15+
background:
16+
dark: '#1A1A17'
17+
light: '#F5F0E8'
18+
border:
19+
dark: '#3A3A30'
20+
light: '#D4C9B5'
21+
sidebar-background:
22+
dark: '#1F1F1B'
23+
light: '#F0EBE1'
24+
header-background:
25+
dark: '#1A1A17'
26+
light: '#F5F0E8'
27+
card-background:
28+
dark: '#252520'
29+
light: '#EDE8DC'
30+
css: ./assets/styles.css
31+
logo:
32+
href: /
33+
dark: ./assets/logo-dark.svg
34+
light: ./assets/logo-light.svg
35+
height: 28
36+
right-text: Multi-Source Docs
37+
```
38+
39+
## Upload workflow
40+
41+
<Steps>
42+
43+
<Step title="Define branding in your docs.yml">
44+
Set colors and CSS in the project that will own the theme (typically the homepage or a shared config project).
45+
</Step>
46+
47+
<Step title="Export the theme">
48+
Run `fern docs theme export` to extract theme-eligible fields into a `theme/` directory.
49+
</Step>
50+
51+
<Step title="Upload to the registry">
52+
Run `fern docs theme upload --name plantstore-theme` to save it under a name your org can reference.
53+
</Step>
54+
55+
<Step title="Reference from other sites">
56+
Each sub-site adds `global-theme: plantstore-theme` to their `docs.yml`. The CLI fetches and applies it at publish time.
57+
</Step>
58+
59+
</Steps>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: Unified theming
3+
subtitle: Consistent branding across independent sites.
4+
---
5+
6+
This Greenhouses site looks the same as every other site on this domain — same colors, same card styles, same typography. That's the `global-theme` at work.
7+
8+
## One theme, six sites
9+
10+
All sites reference the same theme with a single line in their `docs.yml`:
11+
12+
```yaml
13+
global-theme: plantstore-theme
14+
```
15+
16+
The theme is [defined in the homepage project](https://github.com/fern-api/docs-examples/tree/main/multi-source/homepage/fern) and uploaded to Fern's registry. When any site publishes, the CLI fetches the theme and merges it with the local config.
17+
18+
## The color palette
19+
20+
| Token | Light | Dark |
21+
| --- | --- | --- |
22+
| Background | `#F5F0E8` (light tan) | `#1A1A17` |
23+
| Accent | `#1B4332` (forest green) | `#70E155` |
24+
| Border | `#D4C9B5` | `#3A3A30` |
25+
| Sidebar | `#F0EBE1` | `#1F1F1B` |
26+
| Card | `#EDE8DC` | `#252520` |
27+
28+
## Custom CSS
29+
30+
The theme also includes a `styles.css` with subtle refinements:
31+
32+
```css
33+
/* Card hover lift effect */
34+
.fern-card {
35+
transition: transform 0.15s ease, box-shadow 0.15s ease;
36+
}
37+
.fern-card:hover {
38+
transform: translateY(-2px);
39+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
40+
}
41+
```
42+
43+
<Tip>
44+
Toggle dark mode to see both color schemes in action. The theme defines separate values for light and dark modes.
45+
</Tip>

0 commit comments

Comments
 (0)