Switch from TTF to WOFF to fix OG image size issue (#35)

This commit is contained in:
Jared Palmer 2023-06-17 16:11:26 -04:00 committed by GitHub
commit e17364c456
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 5 additions and 5 deletions

View file

@ -14,11 +14,11 @@ export const size = {
export const contentType = 'image/png'
const interRegular = fetch(
new URL('../../../assets/fonts/Inter-Regular.ttf', import.meta.url)
new URL('../../../assets/fonts/Inter-Regular.woff', import.meta.url)
).then(res => res.arrayBuffer())
const interBold = fetch(
new URL('../../../assets/fonts/Inter-Bold.ttf', import.meta.url)
new URL('../../../assets/fonts/Inter-Bold.woff', import.meta.url)
).then(res => res.arrayBuffer())
interface ImageProps {
@ -93,7 +93,9 @@ export default async function Image({ params }: ImageProps) {
<div tw="flex text-[#eaeaf0] ml-2">KV</div>
</div>
</div>
<div tw="text-[1.8rem] ml-auto text-[#9b9ba4]">demo.chat.vercel.ai</div>
<div tw="text-[1.8rem] ml-auto text-[#9b9ba4]">
demo.chat.vercel.ai
</div>
</div>
</div>
),

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -19,7 +19,6 @@ import {
import { useState } from 'react'
import { Button } from './ui/button'
import { Input } from './ui/input'
import { useRouter } from 'next/navigation'
const IS_PREVIEW = process.env.VERCEL_ENV === 'preview'
export interface ChatProps extends React.ComponentProps<'div'> {
@ -28,7 +27,6 @@ export interface ChatProps extends React.ComponentProps<'div'> {
}
export function Chat({ id, initialMessages, className }: ChatProps) {
const router = useRouter()
const [previewToken, setPreviewToken] = useLocalStorage<string | null>(
'ai-token',
null