mirror of
https://github.com/ProjectSegfault/website.git
synced 2024-12-26 23:10:24 +05:30
allow for markdown on announcements
This commit is contained in:
parent
19da680ba0
commit
9f4ee858bd
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
let announcements = data.announcements;
|
||||
|
||||
let description: string = "Open source development and hosted services.";
|
||||
|
||||
</script>
|
||||
|
||||
<SvelteSeo title="Home | Project Segfault" {description} />
|
||||
@ -63,8 +64,10 @@
|
||||
.format("DD/MM/YYYY HH:mm")}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="title">
|
||||
<span class="text-xl font-semibold">{announcements.title}</span>
|
||||
<div class="text-xl font-semibold font-[var(--font-primary)]">{@html data.content}</div>
|
||||
</div>
|
||||
|
||||
{#if announcements.link}
|
||||
|
@ -13,7 +13,7 @@
|
||||
<meta name="description" content={description}>
|
||||
</svelte:head>
|
||||
|
||||
<h1>{title}</h1>
|
||||
<h1>Contact us</h1>
|
||||
|
||||
<span>{description}</span>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user