@graphcommerce/next-ui 6.2.0-canary.46 → 6.2.0-canary.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## 6.2.0-canary.48
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1961](https://github.com/graphcommerce-org/graphcommerce/pull/1961) [`4a759c662`](https://github.com/graphcommerce-org/graphcommerce/commit/4a759c66215eaa69edc342b898e05e8f92c3ba9a) - Add Open Graph meta tags to all pages ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
8
+
9
+ ## 6.2.0-canary.47
10
+
3
11
  ## 6.2.0-canary.46
4
12
 
5
13
  ## 6.2.0-canary.45
@@ -31,6 +31,9 @@ export type PageMetaProps = {
31
31
  metaDescription?: string
32
32
  metaRobots?: MetaRobotsAll | MetaRobots[]
33
33
  children?: React.ReactNode
34
+ ogImage?: string | null
35
+ ogImageUseFallback?: boolean
36
+ ogType?: string | null
34
37
  }
35
38
 
36
39
  type PartialNextRouter = Pick<
@@ -90,7 +93,16 @@ export function useCanonical(incoming?: Canonical) {
90
93
 
91
94
  export function PageMeta(props: PageMetaProps) {
92
95
  const { active } = usePageContext()
93
- const { children, title, canonical: canonicalBare, metaDescription, metaRobots = ['all'] } = props
96
+ const {
97
+ children,
98
+ title,
99
+ canonical: canonicalBare,
100
+ metaDescription,
101
+ ogImage,
102
+ ogType,
103
+ ogImageUseFallback = false,
104
+ metaRobots = ['all'],
105
+ } = props
94
106
 
95
107
  const canonical = useCanonical(canonicalBare)
96
108
 
@@ -99,10 +111,20 @@ export function PageMeta(props: PageMetaProps) {
99
111
  <Head>
100
112
  <title>{title.trim()}</title>
101
113
  {metaDescription && (
102
- <meta name='description' content={metaDescription.trim()} key='meta-description' />
114
+ <>
115
+ <meta name='description' content={metaDescription.trim()} key='meta-description' />
116
+ <meta property='og:description' content={metaDescription.trim()} key='og-description' />
117
+ </>
103
118
  )}
104
119
  <meta name='robots' content={metaRobots.join(',')} key='meta-robots' />
105
120
  {canonical && <link rel='canonical' href={canonical} key='canonical' />}
121
+ <meta property='og:title' content={title.trim()} key='og-title' />
122
+ <meta property='og:type' content={ogType ?? 'website'} key='og-type' />
123
+ <meta property='og:url' content={canonical} key='og-url' />
124
+ {(ogImage || ogImageUseFallback) && (
125
+ <meta property='og:image' content={ogImage ?? '/open-graph-image.jpg'} key='og-image' />
126
+ )}
127
+
106
128
  {children}
107
129
  </Head>
108
130
  )
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/next-ui",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "6.2.0-canary.46",
5
+ "version": "6.2.0-canary.48",
6
6
  "author": "",
7
7
  "license": "MIT",
8
8
  "sideEffects": false,
@@ -18,18 +18,18 @@
18
18
  "@emotion/react": "^11.11.1",
19
19
  "@emotion/server": "^11.11.0",
20
20
  "@emotion/styled": "^11.11.0",
21
- "@graphcommerce/framer-next-pages": "6.2.0-canary.46",
22
- "@graphcommerce/framer-scroller": "6.2.0-canary.46",
23
- "@graphcommerce/framer-utils": "6.2.0-canary.46",
24
- "@graphcommerce/image": "6.2.0-canary.46",
21
+ "@graphcommerce/framer-next-pages": "6.2.0-canary.48",
22
+ "@graphcommerce/framer-scroller": "6.2.0-canary.48",
23
+ "@graphcommerce/framer-utils": "6.2.0-canary.48",
24
+ "@graphcommerce/image": "6.2.0-canary.48",
25
25
  "cookie": "^0.5.0",
26
26
  "react-is": "^18.2.0",
27
27
  "schema-dts": "^1.1.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@graphcommerce/eslint-config-pwa": "6.2.0-canary.46",
31
- "@graphcommerce/prettier-config-pwa": "6.2.0-canary.46",
32
- "@graphcommerce/typescript-config-pwa": "6.2.0-canary.46",
30
+ "@graphcommerce/eslint-config-pwa": "6.2.0-canary.48",
31
+ "@graphcommerce/prettier-config-pwa": "6.2.0-canary.48",
32
+ "@graphcommerce/typescript-config-pwa": "6.2.0-canary.48",
33
33
  "@types/cookie": "^0.5.1",
34
34
  "@types/react-is": "^18.2.0",
35
35
  "typescript": "5.1.3"