Skip to content

Commit b52d96e

Browse files
committed
Format frontend
1 parent 2e9c5c1 commit b52d96e

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import type {PageLoad} from "./$types";
2-
import {marked} from "marked";
3-
import {PUBLIC_API_URL, PUBLIC_BUCKET_URL} from "$env/static/public";
4-
import {type paths} from "$lib/client";
1+
import type { PageLoad } from "./$types";
2+
import { marked } from "marked";
3+
import { PUBLIC_API_URL, PUBLIC_BUCKET_URL } from "$env/static/public";
4+
import { type paths } from "$lib/client";
55
import createClient from "openapi-fetch";
6-
import {error} from "@sveltejs/kit";
6+
import { error } from "@sveltejs/kit";
77

8-
export const load: PageLoad = async ({fetch}) => {
9-
const about = await fetch(PUBLIC_BUCKET_URL + "/system/projects.md")
10-
.then((response) => response.text())
11-
.then((md) => marked.parse(md));
8+
export const load: PageLoad = async ({ fetch }) => {
9+
const about = await fetch(PUBLIC_BUCKET_URL + "/system/projects.md")
10+
.then((response) => response.text())
11+
.then((md) => marked.parse(md));
1212

13-
const client = createClient<paths>({baseUrl: PUBLIC_API_URL, fetch: fetch});
13+
const client = createClient<paths>({ baseUrl: PUBLIC_API_URL, fetch: fetch });
1414

15-
const {data: projects, response} = await client.GET("/projects");
15+
const { data: projects, response } = await client.GET("/projects");
1616

17-
if (!projects) {
18-
error(response.status, await response.text());
19-
}
17+
if (!projects) {
18+
error(response.status, await response.text());
19+
}
2020

21-
return {about, projects};
21+
return { about, projects };
2222
};

frontend/src/routes/projects/[id]/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div class="flex">
2424
<span class="text-white italic hidden lg:block">{day},&nbsp;</span>
2525
<span class="text-white italic">{date}</span>
26-
<span class:hidden={+year !== new Date().getFullYear()} class="text-white italic">,&nbsp;{year}</span>
26+
<span class:hidden={year !== `${new Date().getFullYear()}`} class="text-white italic">,&nbsp;{year}</span>
2727
</div>
2828
</div>
2929
</Overlay>
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
import {error} from "@sveltejs/kit";
2-
import type {PageLoad} from "./$types";
3-
import {marked} from "marked";
4-
import {PUBLIC_API_URL, PUBLIC_BUCKET_URL} from "$env/static/public";
5-
import type {paths} from "$lib/client";
1+
import { error } from "@sveltejs/kit";
2+
import type { PageLoad } from "./$types";
3+
import { marked } from "marked";
4+
import { PUBLIC_API_URL, PUBLIC_BUCKET_URL } from "$env/static/public";
5+
import type { paths } from "$lib/client";
66
import createClient from "openapi-fetch";
77

8-
export const load: PageLoad = async ({params, fetch}) => {
9-
const client = createClient<paths>({baseUrl: PUBLIC_API_URL, fetch: fetch});
8+
export const load: PageLoad = async ({ params, fetch }) => {
9+
const client = createClient<paths>({ baseUrl: PUBLIC_API_URL, fetch: fetch });
1010

11-
const {data: project, response} = await client.GET("/projects/{id}", {
12-
params: {path: {id: params.id}},
13-
});
11+
const { data: project, response } = await client.GET("/projects/{id}", {
12+
params: { path: { id: params.id } },
13+
});
1414

15-
if (!project) {
16-
error(response.status, await response.text());
17-
}
15+
if (!project) {
16+
error(response.status, await response.text());
17+
}
1818

19-
const content = await fetch(`${PUBLIC_BUCKET_URL}/content/${project.id}.md`)
20-
.then((response) => response.text())
21-
.then((md) => marked.parse(md));
19+
const content = await fetch(`${PUBLIC_BUCKET_URL}/content/${project.id}.md`)
20+
.then((response) => response.text())
21+
.then((md) => marked.parse(md));
2222

23-
return {project, content};
23+
return { project, content };
2424
};

0 commit comments

Comments
 (0)