Skip to content

Commit

Permalink
feat: allow users to override the api reference url slug (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored May 8, 2024
1 parent a531d95 commit f3e8b2a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions fern/apis/fdr/definition/docs/v1/write/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ types:
showErrors: optional<boolean>
changelog: optional<ChangelogSection>
hidden: optional<boolean>
urlSlugOverride: optional<string>
fullSlug: optional<list<string>>
navigation: optional<ApiNavigationConfigRoot>
longScrolling: optional<boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface ApiSection {
showErrors?: boolean;
changelog?: FernRegistry.docs.v1.write.ChangelogSection;
hidden?: boolean;
urlSlugOverride?: string;
fullSlug?: string[];
navigation?: FernRegistry.docs.v1.write.ApiNavigationConfigRoot;
longScrolling?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function transformNavigationItemForDb(
longScrolling: writeShape.longScrolling,
flattened: writeShape.flattened,
fullSlug: writeShape.fullSlug,
urlSlug: kebabCase(writeShape.title),
urlSlug: writeShape.urlSlugOverride ?? kebabCase(writeShape.title),
artifacts:
writeShape.artifacts != null ? transformArtifactsForReading(writeShape.artifacts) : undefined,
skipUrlSlug: writeShape.skipUrlSlug ?? false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface ApiSection {
showErrors?: boolean;
changelog?: FernRegistry.docs.v1.write.ChangelogSection;
hidden?: boolean;
urlSlugOverride?: string;
fullSlug?: string[];
navigation?: FernRegistry.docs.v1.write.ApiNavigationConfigRoot;
longScrolling?: boolean;
Expand Down

0 comments on commit f3e8b2a

Please sign in to comment.