Skip to content

Commit 20dd9e8

Browse files
authored
Use Yantramanav in OG cards (#154)
* remove unused font * update OG card
1 parent 622e9bb commit 20dd9e8

File tree

5 files changed

+6
-15
lines changed

5 files changed

+6
-15
lines changed

apps/svelte.dev/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"@codemirror/search": "^6.5.2",
2727
"@codemirror/state": "^6.2.1",
2828
"@codemirror/view": "^6.17.1",
29-
"@fontsource/roboto-mono": "^5.0.8",
3029
"@jridgewell/sourcemap-codec": "^1.4.15",
3130
"@lezer/common": "^1.0.4",
3231
"@lezer/highlight": "^1.1.6",

apps/svelte.dev/src/routes/blog/[slug]/card.png/+server.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import { read } from '$app/server';
55
import satori from 'satori';
66
import { html as toReactNode } from 'satori-html';
77
import Card from './Card.svelte';
8-
// @ts-expect-error no types for the query exist
9-
import CardCSS from './Card.svelte?raw&svelte&type=style';
10-
import OverpassRegular from './Overpass-Regular.ttf?url';
8+
import YantramanavRegular from './Yantramanav-Regular.ttf?url';
119
import { blog_posts } from '$lib/server/content';
1210

1311
export const prerender = true;
@@ -20,15 +18,15 @@ export function entries() {
2018

2119
const height = 630;
2220
const width = 1200;
23-
const data = await read(OverpassRegular).arrayBuffer();
21+
const data = await read(YantramanavRegular).arrayBuffer();
2422

2523
export async function GET({ params }) {
2624
const post = blog_posts.find((post) => post.slug === `blog/${params.slug}`);
2725

2826
if (!post) error(404);
2927

3028
const result = render(Card, { props: { title: post.metadata.title, date: post.date_formatted } });
31-
const element = toReactNode(`${result.body}<style>${CardCSS}</style>`);
29+
const element = toReactNode(`<head>${result.head}</head>${result.body}`);
3230

3331
const svg = await satori(element, {
3432
fonts: [

apps/svelte.dev/src/routes/blog/[slug]/card.png/Card.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<svelte:options css="injected" />
2+
13
<script lang="ts">
24
let { title, date }: { title: string; date: string } = $props();
35
</script>
@@ -16,7 +18,7 @@
1618
display: flex;
1719
width: 100%;
1820
height: 100%;
19-
font-family: 'Overpass';
21+
font-family: 'Yantramanav';
2022
background: white;
2123
}
2224
150 KB
Binary file not shown.

pnpm-lock.yaml

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)