-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helper function for card title and description generation
- Loading branch information
1 parent
c841031
commit f175fea
Showing
3 changed files
with
47 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Markdoc } from '../components/Markdoc' | ||
import { type DocsArray } from '../pages/docs' | ||
|
||
export function getDocsPageCardContent ({ entry }: DocsArray[number]) { | ||
let title = entry.cardTitle || entry.title | ||
let description = entry.cardIntro.children?.length | ||
? entry.cardIntro.children.map((child, i) => <Markdoc key={i} content={child} />) | ||
: entry.description | ||
|
||
return {title, description} | ||
} |
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