Update Wargear Regelwerk
This commit is contained in:
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user