-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sdk and connector selection dropdowns in tutorial title
- Loading branch information
1 parent
7e7af97
commit 81f2dab
Showing
17 changed files
with
650 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { type DocMetadata } from '@docusaurus/plugin-content-docs'; | ||
|
||
export const getSdkDisplayName = (sdk: DocMetadata) => | ||
String(sdk.frontMatter.tutorial_name ?? sdk.frontMatter.sidebar_label ?? ''); | ||
|
||
export const getConnectorDisplayName = (connector: DocMetadata) => | ||
String(connector.frontMatter.tutorial_name ?? connector.frontMatter.sidebar_label ?? ''); | ||
|
||
export const getSdkPath = (metadata: DocMetadata) => { | ||
const sdkName = String(metadata.frontMatter.tutorial_name ?? ''); | ||
|
||
return sdkName | ||
? sdkName.replaceAll(' ', '-').replaceAll(/[()]/g, '').replaceAll('.', 'dot').toLowerCase() | ||
: metadata.slug.split('/').slice(2).join('-'); | ||
}; | ||
|
||
export const getConnectorPath = (metadata: DocMetadata) => { | ||
const connectorName = String( | ||
metadata.frontMatter.tutorial_name ?? metadata.frontMatter.sidebar_label ?? '' | ||
); | ||
|
||
return connectorName.replaceAll(' ', '-').toLowerCase(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.