Update Wargear Regelwerk

This commit is contained in:
2024-01-06 22:37:06 +01:00
parent 36c7505c5d
commit 890f71d144
8 changed files with 628 additions and 208 deletions

View File

@ -52,5 +52,9 @@ const { Content } = await page.render();
pre.astro-code {
@apply w-fit p-4 rounded-md border-2 border-gray-600 my-4;
}
a {
@apply text-neutral-800 dark:text-neutral-400 hover:underline;
}
}
</style>

View File

@ -1,8 +1,8 @@
---
import {getCollection, CollectionEntry} from "astro:content";
import {astroI18n, createGetStaticPaths, t} from "astro-i18n";
import PageLayout from "../../layouts/PageLayout.astro";
import LanguageWarning from "../../components/LanguageWarning.astro";
import PageLayout from "@layouts/PageLayout.astro";
import LanguageWarning from "@components/LanguageWarning.astro";
export const getStaticPaths = createGetStaticPaths(async () => {
let posts = await getCollection("rules", value => value.id.split("/")[0] === astroI18n.locale);
@ -31,13 +31,28 @@ const { page, german } = Astro.props;
const { Content } = await page.render();
---
<PageLayout title={t("title", {mode: t(`${page.data.translationKey}.title`, {}, {route: "/rules"})}, {route: "/rules"})}>
<PageLayout title={t("title", {mode: t(`${page.data.translationKey}.title`)}, {route: "/rules"})}>
<article>
{german && (
<LanguageWarning />
)}
<Content />
</article>
<script>
import {l} from "../../util/util";
class LinkTo extends HTMLElement {
private connectedCallback() {
const text = this.innerHTML;
const href = l("/rules/" + this.dataset["to"]);
this.innerHTML = `<a href="${href}">${text}</a>`;
}
}
customElements.define("link-to", LinkTo);
</script>
</PageLayout>
<style is:global>
@ -53,5 +68,13 @@ const { Content } = await page.render();
pre.astro-code {
@apply w-fit p-4 rounded-md border-2 border-gray-600 my-4;
}
a {
@apply text-neutral-800 dark:text-neutral-400 hover:underline;
}
}
link-to {
display: contents;
}
</style>