Skip to content

Commit

Permalink
feat: landing page + overview page for sections (#1113)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Jul 6, 2024
1 parent cec2247 commit 3b3a3fe
Show file tree
Hide file tree
Showing 60 changed files with 4,988 additions and 4,787 deletions.
3 changes: 3 additions & 0 deletions fern/apis/fdr/definition/docs/v1/db/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ types:
properties:
tabs: optional<list<NavigationTab>>
tabsV2: optional<list<NavigationTabV2>>
landingPage: optional<docsReadV1.PageMetadata>

NavigationTab:
availability: deprecated
Expand All @@ -147,6 +148,7 @@ types:
UnversionedUntabbedNavigationConfig:
properties:
items: list<NavigationItem>
landingPage: optional<docsReadV1.PageMetadata>

VersionedNavigationConfig:
properties:
Expand Down Expand Up @@ -196,3 +198,4 @@ types:
collapsed: boolean
hidden: optional<boolean>
fullSlug: optional<list<string>>
overviewPageId: optional<commons.PageId>
3 changes: 3 additions & 0 deletions fern/apis/fdr/definition/docs/v1/read/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ types:
UnversionedTabbedNavigationConfig:
properties:
tabs: list<NavigationTab>
landingPage: optional<PageMetadata>

NavigationTab:
union:
Expand All @@ -193,6 +194,7 @@ types:
UnversionedUntabbedNavigationConfig:
properties:
items: list<NavigationItem>
landingPage: optional<PageMetadata>

VersionedNavigationConfig:
properties:
Expand Down Expand Up @@ -345,6 +347,7 @@ types:
items: list<NavigationItem>
skipUrlSlug: boolean
collapsed: boolean
overviewPageId: optional<commons.PageId>

ApiArtifacts:
properties:
Expand Down
4 changes: 3 additions & 1 deletion fern/apis/fdr/definition/docs/v1/write/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ types:
type: optional<list<NavigationTab>>
availability: deprecated
tabsV2: optional<list<NavigationTabV2>>
landingPage: optional<PageMetadata>

NavigationTab:
availability: deprecated
Expand Down Expand Up @@ -193,6 +194,7 @@ types:
UnversionedUntabbedNavigationConfig:
properties:
items: list<NavigationItem>
landingPage: optional<PageMetadata>

VersionedNavigationConfig:
properties:
Expand Down Expand Up @@ -382,7 +384,7 @@ types:
This is only applicable to sections that are at the root level in the sidebar.
If false, the section title will be displayed as a header and the items will be displayed below it, and cannot be collapsed.
skipUrlSlug: optional<boolean>
summaryPageId:
overviewPageId:
type: optional<commons.PageId>
availability: in-development
docs: |
Expand Down
17 changes: 15 additions & 2 deletions fern/apis/navigation/definition/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ types:
discriminated: false
union:
- VersionedNode
- TabbedNode
- SidebarRootNode
- UnversionedNode

VersionChild:
discriminated: false
Expand Down Expand Up @@ -71,6 +70,13 @@ types:
type: literal<"versioned">
children: list<VersionNode>

UnversionedNode:
extends: WithNodeId
properties:
type: literal<"unversioned">
child: VersionChild
landingPage: optional<LandingPageNode>

TabbedNode:
extends: WithNodeId
properties:
Expand Down Expand Up @@ -125,6 +131,7 @@ types:
versionId: VersionId
child: VersionChild
availability: optional<Availability>
landingPage: optional<LandingPageNode>

TabNode:
extends:
Expand All @@ -140,6 +147,12 @@ types:
type: literal<"page">
pageId: PageId

LandingPageNode:
extends: WithNodeMetadata
properties:
type: literal<"landingPage">
pageId: PageId

SectionNode:
extends:
- WithNodeMetadata
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,14 @@ function transformUnversionedNavigationConfigForDb(
untabbed: (config) => {
return {
items: config.items.map(transformNavigationItemForDb),
landingPage: transformPageNavigationItemForDb(config.landingPage),
};
},
tabbed: (config) => {
return {
tabs: config.tabs?.map(transformNavigationTabForDb),
tabsV2: config.tabsV2?.map(transformNavigationTabV2ForDb),
landingPage: transformPageNavigationItemForDb(config.landingPage),
};
},
});
Expand Down Expand Up @@ -250,6 +252,7 @@ export function transformNavigationItemForDb(
items: writeShape.items.map((item) => transformNavigationItemForDb(item)),
skipUrlSlug: writeShape.skipUrlSlug ?? false,
fullSlug: writeShape.fullSlug,
overviewPageId: writeShape.overviewPageId,
};
case "link":
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ function transformUnversionedNavigationConfigForDb(
config.tabsV2?.map(transformNavigationTabV2ForDb) ??
config.tabs?.map(transformNavigationTabForDb) ??
[],
landingPage: config.landingPage,
};
},
untabbed: (config) => {
return {
items: config.items.map(transformNavigationItemForDb),
landingPage: config.landingPage,
};
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,7 @@ exports[`getNavigationRoot > primer > gets navigation root for /docs/api/introdu
"hidden": false,
"icon": undefined,
"id": "root..v2.2",
"landingPage": undefined,
"pointsTo": "docs/api/v2.2/introduction/getting-started",
"slug": "docs/api/v2.2",
"title": "v2.2",
Expand Down Expand Up @@ -1494,6 +1495,7 @@ exports[`getNavigationRoot > primer > gets navigation root for /docs/api/introdu
"hidden": false,
"icon": undefined,
"id": "root..v2.1",
"landingPage": undefined,
"pointsTo": "docs/api/v2.1/introduction/getting-started",
"slug": "docs/api/v2.1",
"title": "v2.1",
Expand Down Expand Up @@ -1795,6 +1797,7 @@ exports[`getNavigationRoot > primer > gets navigation root for /docs/api/introdu
"hidden": false,
"icon": undefined,
"id": "root..v2",
"landingPage": undefined,
"pointsTo": "docs/api/v2/introduction/getting-started",
"slug": "docs/api/v2",
"title": "v2",
Expand Down Expand Up @@ -2747,6 +2750,7 @@ exports[`getNavigationRoot > primer > gets navigation root for /docs/api/v2.1/ap
"hidden": false,
"icon": undefined,
"id": "root..v2.2",
"landingPage": undefined,
"pointsTo": "docs/api/v2.2/introduction/getting-started",
"slug": "docs/api/v2.2",
"title": "v2.2",
Expand Down Expand Up @@ -3159,6 +3163,7 @@ exports[`getNavigationRoot > primer > gets navigation root for /docs/api/v2.1/ap
"hidden": false,
"icon": undefined,
"id": "root..v2.1",
"landingPage": undefined,
"pointsTo": "docs/api/v2.1/introduction/getting-started",
"slug": "docs/api/v2.1",
"title": "v2.1",
Expand Down Expand Up @@ -3460,6 +3465,7 @@ exports[`getNavigationRoot > primer > gets navigation root for /docs/api/v2.1/ap
"hidden": false,
"icon": undefined,
"id": "root..v2",
"landingPage": undefined,
"pointsTo": "docs/api/v2/introduction/getting-started",
"slug": "docs/api/v2",
"title": "v2",
Expand Down
Loading

0 comments on commit 3b3a3fe

Please sign in to comment.