-
Notifications
You must be signed in to change notification settings - Fork 389
Open
Labels
Description
https://quarto.org/docs/dashboards/layout.html#navigation
quarto-cli/src/format/dashboard/format-dashboard-shared.ts
Lines 235 to 288 in b289945
| const kNavButtonAliases: Record< | |
| string, | |
| (text?: string) => Promise<NavButton | undefined> | |
| > = { | |
| linkedin: (text?: string) => { | |
| return Promise.resolve({ | |
| icon: "linkedin", | |
| title: "LinkedIn", | |
| href: `https://www.linkedin.com/sharing/share-offsite/?url=|url|&title=${ | |
| text ? encodeURI(text) : undefined | |
| }`, | |
| }); | |
| }, | |
| facebook: (_text?: string) => { | |
| return Promise.resolve({ | |
| icon: "facebook", | |
| title: "Facebook", | |
| href: "https://www.facebook.com/sharer/sharer.php?u=|url|", | |
| }); | |
| }, | |
| reddit: (text?: string) => { | |
| return Promise.resolve({ | |
| icon: "reddit", | |
| title: "Reddit", | |
| href: `https://reddit.com/submit?url=|url|&title=${ | |
| text ? encodeURI(text) : undefined | |
| }`, | |
| }); | |
| }, | |
| twitter: (text?: string) => { | |
| return Promise.resolve({ | |
| icon: "twitter", | |
| title: "Twitter", | |
| href: `https://twitter.com/intent/tweet?url=|url|&text=${ | |
| text ? encodeURI(text) : undefined | |
| }`, | |
| }); | |
| }, | |
| github: async (_text?: string) => { | |
| const context = await gitHubContext(Deno.cwd()); | |
| if (context.repoUrl) { | |
| return { | |
| icon: "github", | |
| title: "GitHub", | |
| href: context.repoUrl, | |
| } as NavButton; | |
| } else { | |
| warning( | |
| "Unable to determine GitHub repository for the `github` nav-button. Is this directory a GitHub repository?", | |
| ); | |
| return undefined; | |
| } | |
| }, | |
| }; |