mirror of
https://github.com/ProjectSegfault/website.git
synced 2024-11-18 06:03:00 +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 type { PageServerLoad } from "./$types";
|
||||||
|
import { compile } from "mdsvex";
|
||||||
|
|
||||||
export const load: PageServerLoad = async () => {
|
export const load: PageServerLoad = async () => {
|
||||||
return {
|
return {
|
||||||
state: await fetch("https://api.projectsegfau.lt/api/v1/state/announcements").then((res) => res.json()),
|
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 announcements = data.announcements;
|
||||||
|
|
||||||
let description: string = "Open source development and hosted services.";
|
let description: string = "Open source development and hosted services.";
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<SvelteSeo title="Home | Project Segfault" {description} />
|
<SvelteSeo title="Home | Project Segfault" {description} />
|
||||||
@ -63,8 +64,10 @@
|
|||||||
.format("DD/MM/YYYY HH:mm")}
|
.format("DD/MM/YYYY HH:mm")}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="title">
|
<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>
|
</div>
|
||||||
|
|
||||||
{#if announcements.link}
|
{#if announcements.link}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<meta name="description" content={description}>
|
<meta name="description" content={description}>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<h1>{title}</h1>
|
<h1>Contact us</h1>
|
||||||
|
|
||||||
<span>{description}</span>
|
<span>{description}</span>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user