Some™️Pages

This commit is contained in:
2023-12-05 15:36:11 +01:00
parent fbd52f3edb
commit 89e6f9cff4
26 changed files with 1046 additions and 27 deletions

View File

@@ -7,7 +7,7 @@ export const getStaticPaths = createGetStaticPaths(async () => {
let posts = await getCollection("rules", value => value.id.split("/")[0] === astroI18n.locale);
return posts.map((page) => ({
props: { page }, params: { slug: page.slug.split("/")[1] }
props: { page }, params: { mode: page.slug.split("/")[1] }
}))
})
@@ -20,8 +20,14 @@ const { Content } = await page.render();
---
<PageLayout title={t("title", {mode: t(`${page.data.translationKey}.title`)})}>
<PageLayout title={t("title", {mode: t(`${page.data.translationKey}.title`, {}, {route: "/rules"})}, {route: "/rules"})}>
<article>
{page.data.german && (
<div class="bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700 p-4" role="alert">
<div class="font-bold">{t("warning.title", {}, {route: "/rules"})}</div>
<div>{t("warning.text", {}, {route: "/rules"})}</div>
</div>
)}
<Content />
</article>
</PageLayout>