Skip to content

Commit c1be525

Browse files
Fix stuff, more HTML
1 parent 6f4a200 commit c1be525

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/routes/og/+server.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import { OG_HEIGHT, OG_WIDTH } from "./constants";
1212
const sansFont = read(Pretendard).arrayBuffer();
1313
const displayFont = read(DMSerifDisplay).arrayBuffer();
1414

15-
// Sources: https://github.com/huggingface/chat-ui/blob/main/src/routes/assistant/%5BassistantId%5D/thumbnail.png/%2Bserver.ts#L44-L82,
15+
// Sources: https://github.com/huggingface/chat-ui/blob/main/src/routes/assistant/%5BassistantId%5D/thumbnail.png/%2Bserver.ts#L44-L82
1616
// https://geoffrich.net/posts/svelte-social-image/
1717
export const GET: RequestHandler = async ({ url }) => {
1818
const renderedComponent = render(Thumbnail, {
1919
props: {
2020
title: url.searchParams.get("title") ?? "",
21-
description: url.searchParams.get("description")
21+
description: url.searchParams.get("description") ?? undefined
2222
}
2323
});
2424

@@ -31,12 +31,14 @@ export const GET: RequestHandler = async ({ url }) => {
3131
{
3232
name: "Pretendard",
3333
data: await sansFont,
34-
weight: 400
34+
weight: 400,
35+
style: "normal"
3536
},
3637
{
3738
name: "DM Serif Display",
3839
data: await displayFont,
39-
weight: 400
40+
weight: 400,
41+
style: "normal"
4042
}
4143
]
4244
});

src/routes/og/Thumbnail.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
let { title, description = undefined }: Props = $props();
88
</script>
99

10-
<div class="size-full">
11-
<p class="font-display">{title}</p>
12-
<p class="text-muted-foreground">{description}</p>
10+
<div class="my-auto flex h-full w-full flex-col justify-center p-4">
11+
<p class="font-display text-7xl">{title}</p>
12+
{#if description}
13+
<p class="text-4xl text-muted-foreground">{description}</p>
14+
{/if}
1315
</div>

0 commit comments

Comments
 (0)