Update Backend

This commit is contained in:
2024-11-23 13:28:33 +01:00
parent e70951c9dd
commit cb65e96165
23 changed files with 493 additions and 310 deletions

View File

@@ -1,5 +1,5 @@
---
import {CollectionEntry, getCollection} from "astro:content";
import {type CollectionEntry, getCollection} from "astro:content";
import {astroI18n, createGetStaticPaths} from "astro-i18n";
import PageLayout from "../layouts/PageLayout.astro";
import LanguageWarning from "../components/LanguageWarning.astro";
@@ -41,7 +41,7 @@ export const getStaticPaths = createGetStaticPaths(async () => {
}));
});
const {page, german} = Astro.props;
const {page, german} = Astro.props as { page: CollectionEntry<"pages">, german: boolean };
const {Content} = await page.render();
---

View File

@@ -61,7 +61,7 @@ const ogImage = await getImage({
},
article: {
publishedTime: post.data.created.toISOString(),
author: "SteamWar.de",
authors: [post.data.author ?? "SteamWar.de"],
tags: post.data.tags,
},
}}
@@ -77,7 +77,7 @@ const ogImage = await getImage({
)}
<div class={post.data.image ? "absolute bottom-8 left-2" : "mb-4"}>
<h1 class="text-4xl mb-0" transition:name={post.data.title + "-title"}>{post.data.title}</h1>
<h5 class="flex items-center mt-2 text-neutral-300">
<div class="flex items-center mt-2 text-neutral-300">
<TagSolid class="w-4 h-4 mr-2"/>
<div transition:name={post.data.title + "-tags"}>
{post.data.tags.map(tag => (
@@ -89,7 +89,14 @@ const ogImage = await getImage({
day: "numeric",
month: "short",
year: "numeric",
}).format(post.data.created)} </h5>
}).format(post.data.created)}
{post.data.author && (
<Fragment>
<Image src={`https://vzge.me/face/64/${post.data.author}`} alt={post.data.author} width={16} height={16} class="mx-1" />
{post.data.author}
</Fragment>
)}
</div>
</div>
</div>
{german && (

View File

@@ -1,6 +1,6 @@
---
import Dashboard from "../components/Dashboard.svelte";
import PageLayout from "../layouts/PageLayout.astro";
import DashboardComponent from "@components/DashboardComponent.svelte";
import PageLayout from "@layouts/PageLayout.astro";
import {t} from "astro-i18n";
---
@@ -16,5 +16,5 @@ import {t} from "astro-i18n";
}
});
</script>
<Dashboard client:only="svelte" />
<DashboardComponent client:only="svelte" />
</PageLayout>

View File

@@ -11,7 +11,7 @@ import {t} from "astro-i18n";
import {l} from "@utils/util";
import PlayerCount from "@components/PlayerCount.svelte";
import "../../public/fonts/barlow-condensed/barlow-condensed.css";
import {Player} from "../components/types/data";
import {type Player} from "../components/types/data";
import PostComponent from "../components/PostComponent.astro";
import BackgroundImage from "../components/BackgroundImage.astro";

View File

@@ -1,5 +1,5 @@
---
import Login from "@components/Login.svelte";
import LoginComponent from "@components/Login.svelte";
import NavbarLayout from "@layouts/NavbarLayout.astro";
import {t} from "astro-i18n";
import BackgroundImage from "../components/BackgroundImage.astro";
@@ -23,6 +23,6 @@ import BackgroundImage from "../components/BackgroundImage.astro";
</div>
<div class="h-screen mx-auto p-8 rounded-b-md pt-40 sm:pt-28 md:pt-14 flex flex-col justify-center items-center
dark:text-white " style="width: min(100vw, 75em);">
<Login client:load/>
<LoginComponent client:load/>
</div>
</NavbarLayout>

View File

@@ -1,6 +1,6 @@
---
import {createGetStaticPaths, t} from "astro-i18n";
import {getCollection, CollectionEntry} from "astro:content";
import {getCollection, type CollectionEntry} from "astro:content";
import PageLayout from "../../layouts/PageLayout.astro";
import EloTable from "../../components/EloTable.svelte";