-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): adding programming languages tabs, more examples to hmac…
… signature verification (#2648)
- Loading branch information
Showing
4 changed files
with
114 additions
and
4 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
33 changes: 33 additions & 0 deletions
33
websites/docs/src/components/ProgrammingLanguagesTabs/ProgrammingLanguagesTabs.astro
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,33 @@ | ||
--- | ||
import {Tabs, TabItem} from '@astrojs/starlight/components'; | ||
import CodeBlock from "../CodeBlock/CodeBlock.astro"; | ||
export interface Props { | ||
code: string | { | ||
javascript?: string; | ||
typescript?: string; | ||
python?: string; | ||
php?: string; | ||
java?: string; | ||
}; | ||
} | ||
const {code} = Astro.props; | ||
const languages = typeof code === 'string' | ||
? [{ label: 'Code', code }] | ||
: [ | ||
{ label: 'JavaScript', code: code.javascript }, | ||
{ label: 'TypeScript', code: code.typescript }, | ||
{ label: 'Python', code: code.python }, | ||
{ label: 'PHP', code: code.php }, | ||
{ label: 'Java', code: code.java } | ||
].filter(lang => lang.code !== undefined); | ||
--- | ||
|
||
<Tabs> | ||
{languages.map(lang => ( | ||
<TabItem label={lang.label}> | ||
<CodeBlock lang={lang.label.toLowerCase()} code={lang.code}/> | ||
</TabItem> | ||
))} | ||
</Tabs> |
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