@gem-sdk/pages 2.5.11 → 2.5.18

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.
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ exports.PublishedThemePageMetafields = void 0;
4
+ (function(PublishedThemePageMetafields) {
5
+ PublishedThemePageMetafields["CUSTOM_CODE_HEADER"] = 'custom_code_header';
6
+ PublishedThemePageMetafields["CUSTOM_CODE_BODY"] = 'custom_code_body';
7
+ PublishedThemePageMetafields["ANALYTICS_GA_TRACKING_ID"] = 'analytics_ga_tracking_id';
8
+ PublishedThemePageMetafields["ANALYTICS_FB_PIXEL_ID"] = 'analytics_fb_pixel_id';
9
+ PublishedThemePageMetafields["ANALYTICS_TIKTOK_PIXEL_ID"] = 'analytics_tiktok_pixel_id';
10
+ PublishedThemePageMetafields["GLOBAL_META_DESCRIPTION"] = 'global-meta-description';
11
+ PublishedThemePageMetafields["GLOBAL_META_TITLE"] = 'global-meta-title';
12
+ PublishedThemePageMetafields["GLOBAL_META_THUMBNAIL"] = 'global-meta-thumbnail';
13
+ PublishedThemePageMetafields["NOINDEX_KEY"] = 'noindex';
14
+ PublishedThemePageMetafields["NOFOLLOW_KEY"] = 'nofollow';
15
+ })(exports.PublishedThemePageMetafields || (exports.PublishedThemePageMetafields = {}));
@@ -11,6 +11,7 @@ var parseJson = require('../helpers/parse-json.js');
11
11
  var nextjs = require('@sentry/nextjs');
12
12
  var customFonts = require('../custom-fonts.js');
13
13
  var genFavicon = require('../helpers/gen-favicon.js');
14
+ var index = require('../../constants/index.js');
14
15
 
15
16
  const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
16
17
  try {
@@ -58,6 +59,7 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
58
59
  ]);
59
60
  const mobileOnly = dataBuilder.isMobile ?? false;
60
61
  const description = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
62
+ const title = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === index.PublishedThemePageMetafields.GLOBAL_META_TITLE)?.value;
61
63
  const thumbnail = parseJson.parseJson(dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-thumbnail')?.value);
62
64
  const noindex = dataBuilder?.metafields?.find((item)=>item?.key === 'noindex')?.value;
63
65
  const nofollow = dataBuilder?.metafields?.find((item)=>item?.key === 'nofollow')?.value;
@@ -66,12 +68,12 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
66
68
  const favicon = shopData?.storeProperty?.favicon ?? '';
67
69
  const seo = {
68
70
  defaultTitle: shopMeta?.shop.name,
69
- title: dataBuilder?.name,
71
+ title: title || dataBuilder?.name,
70
72
  description: description ?? shopMeta?.shop.description,
71
73
  openGraph: {
72
74
  site_name: shopMeta?.shop.name,
73
75
  locale: shopMeta?.localization.country.isoCode,
74
- title: dataBuilder?.name ?? shopMeta?.shop.name,
76
+ title: (title || dataBuilder?.name) ?? shopMeta?.shop.name,
75
77
  description: description ?? shopMeta?.shop.description,
76
78
  images: thumbnail ? [
77
79
  thumbnail
@@ -0,0 +1,15 @@
1
+ var PublishedThemePageMetafields;
2
+ (function(PublishedThemePageMetafields) {
3
+ PublishedThemePageMetafields["CUSTOM_CODE_HEADER"] = 'custom_code_header';
4
+ PublishedThemePageMetafields["CUSTOM_CODE_BODY"] = 'custom_code_body';
5
+ PublishedThemePageMetafields["ANALYTICS_GA_TRACKING_ID"] = 'analytics_ga_tracking_id';
6
+ PublishedThemePageMetafields["ANALYTICS_FB_PIXEL_ID"] = 'analytics_fb_pixel_id';
7
+ PublishedThemePageMetafields["ANALYTICS_TIKTOK_PIXEL_ID"] = 'analytics_tiktok_pixel_id';
8
+ PublishedThemePageMetafields["GLOBAL_META_DESCRIPTION"] = 'global-meta-description';
9
+ PublishedThemePageMetafields["GLOBAL_META_TITLE"] = 'global-meta-title';
10
+ PublishedThemePageMetafields["GLOBAL_META_THUMBNAIL"] = 'global-meta-thumbnail';
11
+ PublishedThemePageMetafields["NOINDEX_KEY"] = 'noindex';
12
+ PublishedThemePageMetafields["NOFOLLOW_KEY"] = 'nofollow';
13
+ })(PublishedThemePageMetafields || (PublishedThemePageMetafields = {}));
14
+
15
+ export { PublishedThemePageMetafields };
@@ -9,6 +9,7 @@ import { parseJson, serializableJson } from '../helpers/parse-json.js';
9
9
  import { captureException } from '@sentry/nextjs';
10
10
  import { getCustomFonts } from '../custom-fonts.js';
11
11
  import { genResizeFaviconUrl } from '../helpers/gen-favicon.js';
12
+ import { PublishedThemePageMetafields } from '../../constants/index.js';
12
13
 
13
14
  const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
14
15
  try {
@@ -56,6 +57,7 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
56
57
  ]);
57
58
  const mobileOnly = dataBuilder.isMobile ?? false;
58
59
  const description = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-description')?.value;
60
+ const title = dataBuilder?.themePageDataSEO?.find((item)=>item?.key === PublishedThemePageMetafields.GLOBAL_META_TITLE)?.value;
59
61
  const thumbnail = parseJson(dataBuilder?.themePageDataSEO?.find((item)=>item?.key === 'global-meta-thumbnail')?.value);
60
62
  const noindex = dataBuilder?.metafields?.find((item)=>item?.key === 'noindex')?.value;
61
63
  const nofollow = dataBuilder?.metafields?.find((item)=>item?.key === 'nofollow')?.value;
@@ -64,12 +66,12 @@ const getStaticPagePropsV2 = (fetcher, shopifyFetcher)=>async (slug)=>{
64
66
  const favicon = shopData?.storeProperty?.favicon ?? '';
65
67
  const seo = {
66
68
  defaultTitle: shopMeta?.shop.name,
67
- title: dataBuilder?.name,
69
+ title: title || dataBuilder?.name,
68
70
  description: description ?? shopMeta?.shop.description,
69
71
  openGraph: {
70
72
  site_name: shopMeta?.shop.name,
71
73
  locale: shopMeta?.localization.country.isoCode,
72
- title: dataBuilder?.name ?? shopMeta?.shop.name,
74
+ title: (title || dataBuilder?.name) ?? shopMeta?.shop.name,
73
75
  description: description ?? shopMeta?.shop.description,
74
76
  images: thumbnail ? [
75
77
  thumbnail
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/pages",
3
- "version": "2.5.11",
3
+ "version": "2.5.18",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -26,7 +26,7 @@
26
26
  "next": "latest"
27
27
  },
28
28
  "devDependencies": {
29
- "@gem-sdk/core": "2.5.11",
29
+ "@gem-sdk/core": "2.5.17",
30
30
  "@gem-sdk/plugin-cookie-bar": "2.1.0",
31
31
  "@gem-sdk/plugin-quick-view": "2.1.0",
32
32
  "@gem-sdk/plugin-sticky-add-to-cart": "2.1.0"