Skip to content

Commit

Permalink
internally decide to wrap authors
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane98c committed Dec 18, 2024
1 parent 3c2ee03 commit 343d9da
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pages/api/og.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,14 @@ const getFonts = async () => {
{
name: 'heading',
data: relativeMedium,
fontWeight: 'normal',
},
{
name: 'faux',
data: faux,
fontWeight: 'normal',
},
{
name: 'mono',
data: mono,
fontWeight: 'normal',
},
]
} catch (error) {
Expand All @@ -75,9 +72,8 @@ export default async function handler(req) {
authors = [authorsString]
}

const wrapAuthors = authors.length > 3
const date = searchParams.get('date')
const number = searchParams.get('number')
const wrapAuthors = searchParams.get('wrapAuthors') === 'true'

return new ImageResponse(
(
Expand Down Expand Up @@ -127,12 +123,15 @@ export default async function handler(req) {
maxWidth: '800px',
fontSize: '64px',
marginTop: '44px',
marginBottom: '42px',
color: theme.colors.primary,
fontFamily: 'heading',
letterSpacing: '-0.015em',
lineHeight: '1.05',
WebkitTextStroke: '1px currentColor',
display: '-webkit-box',
WebkitLineClamp: 4,
WebkitBoxOrient: 'vertical',
textOverflow: 'ellipsis',
}}
>
{title}
Expand All @@ -157,7 +156,7 @@ export default async function handler(req) {
key={author}
style={{
display: 'flex',
color: theme.colors[AUTHOR_COLORS[(number + i) % 4]],
color: theme.colors[AUTHOR_COLORS[i % 4]],
WebkitTextStroke: '1px currentColor',
}}
>
Expand Down

0 comments on commit 343d9da

Please sign in to comment.