Fixing and Sitemap and Robots.txt

This commit is contained in:
2023-12-10 17:14:10 +01:00
parent 3d95bffb6a
commit 6c9c496f05
33 changed files with 150 additions and 57 deletions

View File

@@ -0,0 +1,8 @@
---
import {t} from "astro-i18n";
---
<div class="bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700 p-4" role="alert">
<p class="font-bold">{t("warning.title")}</p>
<p>{t("warning.text")}</p>
</div>

11
src/components/P.astro Normal file
View File

@@ -0,0 +1,11 @@
---
interface Props {
class: string;
}
const { class: s } = Astro.props as Props;
---
<p class={s}>
<slot></slot>
</p>

View File

@@ -4,6 +4,7 @@ import {l} from "../util/util";
import {astroI18n} from "astro-i18n";
import {Image} from "astro:assets";
import TagComponent from "./TagComponent.astro";
import P from "./P.astro";
interface Props {
post: CollectionEntry<'announcements'>
@@ -21,12 +22,12 @@ const { post } = Astro.props as Props;
) : null}
<div>
<h2 class="text-2xl font-bold">{post.data.title}</h2>
<div class="text-gray-500">{Intl.DateTimeFormat(astroI18n.locale, {
<P class="text-gray-500">{Intl.DateTimeFormat(astroI18n.locale, {
day: "numeric",
month: "long",
year: "numeric"
}).format(post.data.created)}</div>
<div>{post.data.description}</div>
}).format(post.data.created)}</P>
<P>{post.data.description}</P>
<div>
{post.data.tags.map((tag) => (
<TagComponent tag={tag} />

View File

@@ -22,7 +22,7 @@
import wrap from "svelte-spa-router/wrap";
import Router, {replace} from "svelte-spa-router";
import {get} from "svelte/store";
import {tokenStore} from "../repo/repo.js";
import {tokenStore} from "../repo/repo";
const routes: RouteDefinition = {
'/': wrap({asyncComponent: () => import('./pages/Home.svelte'), conditions: detail => get(tokenStore) != ""}),

View File

@@ -20,7 +20,7 @@
<script lang="ts">
import {Input, Label, Select} from "flowbite-svelte";
import TypeAheadSearch from "./TypeAheadSearch.svelte";
import {gamemodes, groups, maps, players} from "../../stores/stores.js";
import {gamemodes, groups, maps, players} from "../../stores/stores";
import type {Team} from '../../types/team.js';
export let teams: Team[] = [];

View File

@@ -20,7 +20,7 @@
<script lang="ts">
import {ArrowLeftSolid} from "flowbite-svelte-icons";
import {Button, Card, Input, Label, Navbar, NavBrand, NavHamburger, NavUl, Spinner} from "flowbite-svelte";
import {pageRepo} from "../../repo/repo.js";
import {pageRepo} from "../../repo/repo";
import {mapToMap, nameRegex} from "../util.ts";
import TypeAheadSearch from "../components/TypeAheadSearch.svelte";
import {branches} from "../../stores/stores.ts";

View File

@@ -22,7 +22,7 @@
import EventEdit from "./event/EventEdit.svelte";
import {ArrowLeftSolid} from "flowbite-svelte-icons";
import FightList from "./event/FightList.svelte";
import {eventRepo} from "../../repo/repo.js";
import {eventRepo} from "../../repo/repo";
import TeamList from "./event/TeamList.svelte";
export let params: { id: number };

View File

@@ -22,7 +22,7 @@
import EventEdit from "./event/EventEdit.svelte";
import {ArrowLeftSolid} from "flowbite-svelte-icons";
import FightList from "./event/FightList.svelte";
import {eventRepo} from "../../repo/repo.js";
import {eventRepo} from "../../repo/repo";
import TeamList from "./event/TeamList.svelte";
import GroupGenerator from "./generate/GroupGenerator.svelte";

View File

@@ -24,7 +24,7 @@
import {PlusSolid} from "flowbite-svelte-icons";
import EventCard from "./home/EventCard.svelte";
import CreateEventModal from "./home/CreateEventModal.svelte";
import {eventRepo, tokenStore} from "../../repo/repo.js";
import {eventRepo, tokenStore} from "../../repo/repo";
let events = $eventRepo.listEvents()
let showAdd = false

View File

@@ -22,7 +22,7 @@
import {fly} from "svelte/transition";
import {replace} from "svelte-spa-router";
import {EyeOutline, EyeSlashOutline, EyeSolid} from "flowbite-svelte-icons";
import {fetchWithToken, tokenStore} from "../../repo/repo.js";
import {fetchWithToken, tokenStore} from "../../repo/repo";
let show = false;
let loading = false;

View File

@@ -20,11 +20,11 @@
<script lang="ts">
import type {ExtendedEvent} from "../../../types/event.js";
import {Button, Heading, Input, Label, Modal, Range, Select, Toast, Toggle} from "flowbite-svelte";
import {schemTypes} from "../../../stores/stores.js";
import {schemTypes} from "../../../stores/stores";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc"
import type {UpdateEvent} from "../../../repo/event.js";
import {eventRepo} from "../../../repo/repo.js";
import {eventRepo} from "../../../repo/repo";
import ErrorModal from "../../components/ErrorModal.svelte";
import {replace} from "svelte-spa-router";
import {CheckCircleOutline} from "flowbite-svelte-icons";

View File

@@ -23,8 +23,8 @@
import type {EventFight, ExtendedEvent} from "../../../types/event.js";
import FightEditModal from "./modals/FightEditModal.svelte";
import {createEventDispatcher, onMount} from "svelte";
import {fightRepo} from "../../../repo/repo.js";
import {isWide} from "../../../stores/stores.js";
import {fightRepo} from "../../../repo/repo";
import {isWide} from "../../../stores/stores";
export let fight: EventFight;
export let data: ExtendedEvent;

View File

@@ -36,8 +36,8 @@
} from "flowbite-svelte-icons";
import FightCard from "./FightCard.svelte";
import CreateFightModal from "./modals/CreateFightModal.svelte";
import {fightRepo} from "../../../repo/repo.js";
import {groups, players} from "../../../stores/stores.js";
import {fightRepo} from "../../../repo/repo";
import {groups, players} from "../../../stores/stores";
import TypeAheadSearch from "../../components/TypeAheadSearch.svelte";
import type {UpdateFight} from "../../../repo/fight.js";
import dayjs from "dayjs";

View File

@@ -21,7 +21,7 @@
import {Button, Modal} from "flowbite-svelte";
import type {ExtendedEvent} from "../../../../types/event.js";
import FightEditPart from "../../../components/FightEditPart.svelte";
import {fightRepo} from "../../../../repo/repo.js";
import {fightRepo} from "../../../../repo/repo";
import type {CreateFight} from "../../../../repo/fight.ts";
import ErrorModal from "../../../components/ErrorModal.svelte";
import {createEventDispatcher} from "svelte";

View File

@@ -22,7 +22,7 @@
import type {EventFight, ExtendedEvent} from "../../../../types/event.js";
import FightEditPart from "../../../components/FightEditPart.svelte";
import type {UpdateFight} from "../../../../repo/fight.js";
import {fightRepo} from "../../../../repo/repo.js";
import {fightRepo} from "../../../../repo/repo";
import ErrorModal from "../../../components/ErrorModal.svelte";
import {createEventDispatcher} from "svelte";
import dayjs from "dayjs";

View File

@@ -23,9 +23,9 @@
import type {Team} from "../../../types/team.js";
import DragAcceptor from "./DragAcceptor.svelte";
import {Button, Input, Label, Modal, Range, Select} from "flowbite-svelte";
import {gamemodes, maps} from "../../../stores/stores.js";
import {gamemodes, maps} from "../../../stores/stores";
import {PlusSolid} from "flowbite-svelte-icons";
import {fightRepo} from "../../../repo/repo.js";
import {fightRepo} from "../../../repo/repo";
import {replace} from "svelte-spa-router";
import dayjs from "dayjs";

View File

@@ -19,7 +19,7 @@
<script lang="ts">
import type {Team} from "../../../types/team.js";
import {brightness, colorFromTeam, lighten} from "../../util.js";
import {brightness, colorFromTeam, lighten} from "../../util";
export let team: Team;

View File

@@ -21,7 +21,7 @@
import {Button, Input, Label, Modal} from "flowbite-svelte";
import {createEventDispatcher} from "svelte";
import ErrorModal from "../../components/ErrorModal.svelte";
import {eventRepo} from "../../../repo/repo.js";
import {eventRepo} from "../../../repo/repo";
import dayjs from "dayjs";
export let open = false;

View File

@@ -18,7 +18,7 @@
*/
import type {ExtendedEvent, ShortEvent, SWEvent} from "../types/event.js";
import {fetchWithToken} from "./repo.js";
import {fetchWithToken} from "./repo";
import {ExtendedEventSchema, ShortEventSchema, SWEventSchema} from "../types/event.js";
import {z} from "zod";
import type {Dayjs} from "dayjs";

View File

@@ -18,7 +18,7 @@
*/
import type {EventFight} from "../types/event.js";
import {fetchWithToken} from "./repo.js";
import {fetchWithToken} from "./repo";
import {z} from "zod";
import {EventFightSchema} from "../types/event.js";
import type {Dayjs} from "dayjs";

View File

@@ -18,7 +18,7 @@
*/
import type {Perms, UserPerms} from "../types/perms.js";
import {fetchWithToken} from "./repo.js";
import {fetchWithToken} from "./repo";
import {PermsSchema, UserPermsSchema} from "../types/perms.js";
export class PermsRepo {

View File

@@ -23,7 +23,7 @@ import {cached, cachedFamily} from "./cached.js";
import type {Team} from "../types/team.js";
import {TeamSchema} from "../types/team.js";
import {derived, get, writable} from "svelte/store";
import {dataRepo, fetchWithToken, pageRepo, tokenStore} from "../repo/repo.js";
import {dataRepo, fetchWithToken, pageRepo, tokenStore} from "../repo/repo";
import {z} from "zod";
export const schemTypes = cached<SchematicType[]>([], () =>