Skip to content

Commit 311f819

Browse files
committed
chore(blog): improved generated open graph image
1 parent 3b58cbd commit 311f819

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

apps/blog/src/app/(public)/blog/[collection]/[slug]/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ export async function generateStaticParams() {
4545
export async function generateMetadata({ params }: Props): Promise<Metadata> {
4646
const { slug } = await params
4747
const article = getArticleBySlug(slug)
48-
const ogImageUrl = `/og?title=${encodeURIComponent(
49-
article.title
50-
)}&description=${encodeURIComponent(article.description)}`
48+
const ogImageUrl = `${config.baseUrl}/og?title=${encodeURIComponent(article.title)}&description=${encodeURIComponent(article.description)}`
5149

5250
return {
5351
title: article.title,

apps/blog/src/app/(public)/snippets/[slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
2424
const { slug } = await params
2525
const snippet = getSnippetBySlug(slug)
2626

27-
const title = `${snippet.title} | Snippet by ${config.author}`
27+
const title = `${snippet.title} | Snippets`
2828
const description = snippet.description
2929
const url = `${config.baseUrl}/snippets/${snippet.slug}`
3030

apps/blog/src/app/og/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export async function GET(request: Request) {
4747
const { searchParams } = new URL(request.url)
4848
const title = searchParams.get('title')
4949
const description = searchParams.get('description')
50-
const frame = searchParams.get('frame') === '0' ? false : true
50+
const frame = searchParams.get('frame') === '1' ? true : false
5151

5252
const [fonts] = await Promise.all([loadAssets()])
5353

@@ -101,7 +101,7 @@ export async function GET(request: Request) {
101101
{title}
102102
</div>
103103
<div
104-
tw="text-[40px] leading-[1.5] flex-grow-1 text-zinc-500"
104+
tw="text-[40px] leading-[1.5] flex-grow-1 text-zinc-300"
105105
style={{
106106
textWrap: 'balance',
107107
fontWeight: 400,

0 commit comments

Comments
 (0)