Website/src/pages/downloads.astro

31 Zeilen
1.1 KiB
Plaintext

2023-11-18 16:52:54 +01:00
---
import PageLayout from "../layouts/PageLayout.astro";
import {getCollection} from "astro:content";
import {t} from "astro-i18n";
2023-12-05 17:36:31 +01:00
import {l} from "../util/util";
2023-11-18 16:52:54 +01:00
const downloads = await getCollection("downloads");
---
<PageLayout title="Downloads">
{downloads.map(e => (
<div class="pt-4">
2024-02-11 11:16:23 +01:00
<h1 class="font-bold text-2xl">{e.data.name}</h1>
2023-11-18 16:52:54 +01:00
<div class="py-4">{t(e.data.description)}</div>
<div class="flex flex-col">
2023-12-23 15:36:22 +01:00
{typeof e.data.url === "object" ?
2023-11-18 16:52:54 +01:00
Object.entries(e.data.url).map(value => (
2024-02-11 11:16:23 +01:00
<a href={value[1].startsWith("/") ? l(value[1]) : value[1]}
class="text-blue-500 hover:underline w-fit">{t(value[0])}</a>
2023-11-18 16:52:54 +01:00
))
2023-12-23 15:36:22 +01:00
:
2023-11-18 16:52:54 +01:00
<a href={e.data.url} class="text-blue-500 hover:underline w-fit">{t("Download")}</a>
}
2024-02-11 11:16:23 +01:00
{e.data.sourceUrl ?
<a class="text-blue-500 hover:underline w-fit" href={e.data.sourceUrl}>Quelle</a>
: null}
2023-11-18 16:52:54 +01:00
</div>
</div>
))}
</PageLayout>