MCPcopy
hub / github.com/intentui/intentui / ogImage

Function ogImage

src/lib/og.ts:1–15  ·  view source on GitHub ↗
(params: { title: string; description?: string })

Source from the content-addressed store, hash-verified

1export function ogImage(params: { title: string; description?: string }): string {
2 const title = params.title.trim()
3 const normalizedTitle = title ? title[0].toUpperCase() + title.slice(1).toLowerCase() : ''
4
5 const search = new URLSearchParams({ title: normalizedTitle })
6
7 if (params.description) {
8 const s = params.description.trim()
9 const i = s.indexOf('.')
10 const description = (i === -1 ? s : s.slice(0, i + 1)).trim()
11 if (description) search.set('description', description)
12 }
13
14 return `/og?${search.toString()}`
15}

Callers 4

createMetadataFunction · 0.90
generateMetadataFunction · 0.90
layout.tsxFile · 0.90
generateMetadataFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected