@graphcommerce/magento-category 4.0.15 → 4.1.0
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,11 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1434](https://github.com/graphcommerce-org/graphcommerce/pull/1434) [`3c1c9ce2a`](https://github.com/graphcommerce-org/graphcommerce/commit/3c1c9ce2a947386515df019c31d697114a87dc07) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Add page number to meta title and description
|
|
8
|
+
|
|
3
9
|
## 4.0.15
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -6,16 +6,22 @@ import { CategoryMetaFragment } from './CategoryMeta.gql'
|
|
|
6
6
|
type CategoryMetaProps = CategoryMetaFragment &
|
|
7
7
|
Omit<PageMetaProps, 'title' | 'metaDescription'> & {
|
|
8
8
|
params?: ProductListParams
|
|
9
|
+
current_page?: number | null | undefined
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export function CategoryMeta(props: CategoryMetaProps) {
|
|
12
|
-
const { name, meta_title, meta_description, params, ...pageMetaProps } = props
|
|
13
|
+
const { name, meta_title, meta_description, current_page, params, ...pageMetaProps } = props
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
13
15
|
const anyFilterActive = Object.keys(params?.filters ?? {}).length > 0
|
|
14
16
|
|
|
15
17
|
return (
|
|
16
18
|
<PageMeta
|
|
17
|
-
title={meta_title ?? name ?? ''}
|
|
18
|
-
|
|
19
|
+
title={`${meta_title ?? name ?? ''} ${
|
|
20
|
+
current_page && current_page > 1 ? `- Page ${current_page}` : ''
|
|
21
|
+
}`}
|
|
22
|
+
metaDescription={`${meta_description ?? undefined} ${
|
|
23
|
+
current_page && current_page > 1 ? `- Page ${current_page}` : ''
|
|
24
|
+
}`}
|
|
19
25
|
metaRobots={anyFilterActive ? ['noindex'] : undefined}
|
|
20
26
|
canonical={`/${params?.url}${
|
|
21
27
|
(params?.currentPage ?? 1) > 1 ? `/q/page/${params?.currentPage}` : ''
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-category",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "4.0
|
|
5
|
+
"version": "4.1.0",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|