diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index 846d961..28fba08 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -1,8 +1,11 @@ import type { PageServerLoad } from "./$types"; +import { compile } from "mdsvex"; export const load: PageServerLoad = async () => { return { state: await fetch("https://api.projectsegfau.lt/api/v1/state/announcements").then((res) => res.json()), - announcements: await fetch("https://api.projectsegfau.lt/api/v1/announcements").then((res) => res.json()) + announcements: await fetch("https://api.projectsegfau.lt/api/v1/announcements").then((res) => res.json()), + content: await fetch("https://api.projectsegfau.lt/api/v1/announcements").then((res) => res.json()).then((res) => compile(res.title)).then((res) => res.code) } -} \ No newline at end of file +} + diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index ddfcc4e..927945c 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -10,6 +10,7 @@ let announcements = data.announcements; let description: string = "Open source development and hosted services."; + @@ -63,8 +64,10 @@ .format("DD/MM/YYYY HH:mm")} + +
- {announcements.title} +
{@html data.content}
{#if announcements.link} diff --git a/src/routes/contact/+page.svelte b/src/routes/contact/+page.svelte index 23aa112..796746a 100644 --- a/src/routes/contact/+page.svelte +++ b/src/routes/contact/+page.svelte @@ -13,7 +13,7 @@ -

{title}

+

Contact us

{description}