Optimize WarGear Links
This commit is contained in:
@@ -7,6 +7,8 @@ import LanguageWarning from "@components/LanguageWarning.astro";
|
||||
export const getStaticPaths = createGetStaticPaths(async () => {
|
||||
let posts = await getCollection("rules", value => value.id.split("/")[0] === astroI18n.locale);
|
||||
|
||||
console.log(posts);
|
||||
|
||||
const germanPosts = await getCollection("rules", entry => entry.id.split("/")[0] === "de");
|
||||
|
||||
germanPosts.forEach(value => {
|
||||
@@ -38,21 +40,6 @@ const {Content} = await page.render();
|
||||
)}
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user