From 1a0f5c1d59fe68bb827c3f688a2b0bbe8b1f9a19 Mon Sep 17 00:00:00 2001 From: ferrreo Date: Fri, 17 Feb 2023 14:46:32 +0000 Subject: [PATCH] Update download section so it can handle mirrors and different ISOs --- src/components/widgets/CallToAction.astro | 2 +- src/components/widgets/Downloads.astro | 51 +++++++++++++++++++++++ src/components/widgets/Hero.astro | 2 +- src/pages/index.astro | 30 ++++++++----- 4 files changed, 73 insertions(+), 12 deletions(-) create mode 100644 src/components/widgets/Downloads.astro diff --git a/src/components/widgets/CallToAction.astro b/src/components/widgets/CallToAction.astro index 584bfe7..eb076fa 100644 --- a/src/components/widgets/CallToAction.astro +++ b/src/components/widgets/CallToAction.astro @@ -43,7 +43,7 @@ const { callToAction.text && callToAction.href && (
- + {callToAction.icon && } {callToAction.text} diff --git a/src/components/widgets/Downloads.astro b/src/components/widgets/Downloads.astro new file mode 100644 index 0000000..a1db50c --- /dev/null +++ b/src/components/widgets/Downloads.astro @@ -0,0 +1,51 @@ +--- +import { Icon } from 'astro-icon'; + +interface Download { + text: string; + hrefEU: string; + hrefWW: string; + md5: string; + isComgingSoon: boolean; +} + +export interface Props { + title?: string; + description?: string; + downloads: Array; +} + +const { + title = await Astro.slots.render('title'), + subtitle = await Astro.slots.render('subtitle'), + downloads = [], +} = Astro.props; +--- + +
+
+
+
+ { + title && ( +

+ ) + } + {subtitle &&

} +

ISO
EU Mirror
World Mirror
hash
+ { + downloads && + downloads.map((download) => ( +
{download.text}
{download.isComgingSoon ? "Coming Soon" : ({}ISO)}
{download.isComgingSoon ? "Coming Soon" : ({}ISO)}
{download.isComgingSoon ? "Coming Soon" : ({}MD5)}
+ )) + } +
+

+
+
+
diff --git a/src/components/widgets/Hero.astro b/src/components/widgets/Hero.astro index 6075fd8..cdbc028 100644 --- a/src/components/widgets/Hero.astro +++ b/src/components/widgets/Hero.astro @@ -46,7 +46,7 @@ const { {typeof callToAction === 'string' ? ( ) : ( - + {callToAction?.icon && ( <> {' '} diff --git a/src/pages/index.astro b/src/pages/index.astro index 8f8ca3f..3c9d9bd 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -11,6 +11,7 @@ import Content from "~/components/widgets/Content.astro"; import FAQs from "~/components/widgets/FAQs.astro"; import Stats from "~/components/widgets/Stats.astro"; import CallToAction from "~/components/widgets/CallToAction.astro"; +import Downloads from "~/components/widgets/Downloads.astro"; const meta = { title: SITE.title, @@ -25,7 +26,7 @@ const meta = {