From d6674f75046406c1125bddde526a506e90b993c6 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Mon, 24 Apr 2023 13:13:30 +0200 Subject: [PATCH] feat: add More and Download links --- src/components/DownloadLink.astro | 23 +++++++++++++++++++++++ src/components/MoreLink.astro | 23 +++++++++++++++++++++++ src/components/index.ts | 5 +++++ src/mdx-components.ts | 4 ++++ 4 files changed, 55 insertions(+) create mode 100644 src/components/DownloadLink.astro create mode 100644 src/components/MoreLink.astro diff --git a/src/components/DownloadLink.astro b/src/components/DownloadLink.astro new file mode 100644 index 0000000..e5cbe9e --- /dev/null +++ b/src/components/DownloadLink.astro @@ -0,0 +1,23 @@ +--- +import { Sprite } from 'astro-icon'; + +import { TextLink } from '../components'; + +export interface Props { + href: string; + text: string; +} + +const { href, text, ...props } = Astro.props; +--- + + + {text} + + + diff --git a/src/components/MoreLink.astro b/src/components/MoreLink.astro new file mode 100644 index 0000000..1db9f32 --- /dev/null +++ b/src/components/MoreLink.astro @@ -0,0 +1,23 @@ +--- +import { Sprite } from 'astro-icon'; + +import { TextLink } from '../components'; + +export interface Props { + href: string; + text: string; +} + +const { href, text, ...props } = Astro.props; +--- + + + {text} + + + diff --git a/src/components/index.ts b/src/components/index.ts index 3bc44e0..f33ea03 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,3 +1,7 @@ +// @ts-nocheck +import DownloadLink from './DownloadLink.astro'; +import MoreLink from './MoreLink.astro'; + export * from './AffiliateLink'; export * from './AmazonBook'; export * from './Banner'; @@ -22,3 +26,4 @@ export * from './Title'; export * from './UnorderedList'; export * from './Verse'; export * from './YouTubeVideo'; +export { DownloadLink, MoreLink }; diff --git a/src/mdx-components.ts b/src/mdx-components.ts index 76b7e77..40097ce 100644 --- a/src/mdx-components.ts +++ b/src/mdx-components.ts @@ -5,10 +5,12 @@ import { Book, ColorSwatch, Divider, + DownloadLink, Flag, Headline, Image, ListItem, + MoreLink, NetflixFlag, OdyseeVideo, OrderedList, @@ -30,6 +32,7 @@ export const mapping = { Banner, Book, ColorSwatch, + DownloadLink, Flag, h1: Title, h2: Headline, @@ -40,6 +43,7 @@ export const mapping = { hr: Divider, img: Image, li: ListItem, + MoreLink, NetflixFlag, OdyseeVideo, ol: OrderedList,