Skip to content

Commit ce89845

Browse files
committed
chore(docs): 📝 add og tags
1 parent 76315b7 commit ce89845

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/theme.config.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useRouter } from 'next/router'
12
import { DocsThemeConfig } from 'nextra-theme-docs'
23
import React from 'react'
34

@@ -10,6 +11,34 @@ const config: DocsThemeConfig = {
1011
project: {
1112
link: 'https://github.com/mcnaveen/cart',
1213
},
14+
useNextSeoProps() {
15+
const { asPath } = useRouter()
16+
if (asPath !== '/') {
17+
return {
18+
titleTemplate: '%s – Cart'
19+
}
20+
}
21+
},
22+
head: (
23+
<>
24+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
25+
<meta property="og:title" content="Cart - An Open Source headless cart management library" />
26+
<meta property="og:description" content="$ npm install cart" />
27+
28+
<meta property="og:type" content="website" />
29+
<meta property="og:url" content="https://cart.js.org/" />
30+
<meta property="og:title" content="Cart - An Open Source headless cart management library" />
31+
<meta property="og:description" content="$ npm install cart" />
32+
<meta property="og:image" content="https://raw.githubusercontent.com/mcnaveen/cart/HEAD/image/cover.png" />
33+
34+
<meta property="twitter:card" content="summary_large_image" />
35+
<meta property="twitter:url" content="https://cart.js.org/" />
36+
<meta property="twitter:title" content="Cart - An Open Source headless cart management library" />
37+
<meta property="twitter:description" content="$ npm install cart" />
38+
<meta property="twitter:image" content="https://raw.githubusercontent.com/mcnaveen/cart/HEAD/image/cover.png" />
39+
40+
</>
41+
)
1342
}
1443

1544
export default config

0 commit comments

Comments
 (0)