Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

seo.ts

33 lines885 Bytes

1export const seo = ({
2 title,
3 description,
4 keywords,
5 image,
6}: {
7 title: string
8 description?: string
9 image?: string
10 keywords?: string
11}) => {
12 const tags = [
13 { title },
14 { name: `description`, content: description },
15 { name: `keywords`, content: keywords },
16 { name: `twitter:title`, content: title },
17 { name: `twitter:description`, content: description },
18 { name: `twitter:creator`, content: `@tannerlinsley` },
19 { name: `twitter:site`, content: `@tannerlinsley` },
20 { name: `og:type`, content: `website` },
21 { name: `og:title`, content: title },
22 { name: `og:description`, content: description },
23 ...(image
24 ? [
25 { name: `twitter:image`, content: image },
26 { name: `twitter:card`, content: `summary_large_image` },
27 { name: `og:image`, content: image },
28 ]
29 : []),
30 ]
31​
32 return tags