From 3f15c7e8e7998f2b062a4f750fb779e7113e661c Mon Sep 17 00:00:00 2001 From: caroolcanelas2 <160874012+caroolcanelas2@users.noreply.github.com> Date: Tue, 10 Jun 2025 14:07:56 -0300 Subject: [PATCH 1/8] fix/removeStoreNameTitle Fix the og:title not taking into consideration the removeStoreNameTitle tag from store settings --- react/ProductOpenGraph.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/react/ProductOpenGraph.tsx b/react/ProductOpenGraph.tsx index 61a37c0..d16c254 100644 --- a/react/ProductOpenGraph.tsx +++ b/react/ProductOpenGraph.tsx @@ -46,14 +46,14 @@ function ProductOpenGraph() { try { const settings = getSettings('vtex.store') - + if (settings) { - const { storeName, titleTag: storeTitleTag } = settings - const suffix = - (storeTitleTag || storeName) && ` - ${storeTitleTag || storeName}` - - if (suffix) { - title += suffix + if (!settings.removeStoreNameTitle) { + const { storeName, titleTag: storeTitleTag } = settings + const suffix = (storeTitleTag || storeName) && ` - ${storeTitleTag || storeName}` + if (suffix) { + title += suffix + } } } } catch (e) { From 57c605fda74a30821c0a6b2679a8662acac373df Mon Sep 17 00:00:00 2001 From: caroolcanelas2 <160874012+caroolcanelas2@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:00:26 -0300 Subject: [PATCH 2/8] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3209559..7730cb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [1.4.1] - 2025-07-31 + +### Fixed +- The og:title was not respecting the removeStoreNameTitle tag from store settings. + ### Changed - Update GitHub actions/cache to v4 From 8f9b58e106ef77b901b51fe1279f57ea53580448 Mon Sep 17 00:00:00 2001 From: caroolcanelas2 <160874012+caroolcanelas2@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:17:40 -0300 Subject: [PATCH 3/8] Update ProductOpenGraph.tsx Correcting the 2 ifs in the removeStoreNameTitle --- react/ProductOpenGraph.tsx | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/react/ProductOpenGraph.tsx b/react/ProductOpenGraph.tsx index d16c254..cf6e543 100644 --- a/react/ProductOpenGraph.tsx +++ b/react/ProductOpenGraph.tsx @@ -44,21 +44,18 @@ function ProductOpenGraph() { let title = titleTag || productName - try { - const settings = getSettings('vtex.store') - - if (settings) { - if (!settings.removeStoreNameTitle) { - const { storeName, titleTag: storeTitleTag } = settings - const suffix = (storeTitleTag || storeName) && ` - ${storeTitleTag || storeName}` - if (suffix) { - title += suffix - } +try { + const settings = getSettings('vtex.store') + if (!settings.removeStoreNameTitle) { + const { storeName, titleTag: storeTitleTag } = settings + const suffix = (storeTitleTag || storeName) && ` - ${storeTitleTag || storeName}` + if (suffix) { + title += suffix } } - } catch (e) { - console.error('Failed to suffix store name in title.', e) - } +} catch (e) { + console.error('Failed to suffix store name in title.', e) +} const metaTags = [ { property: 'og:type', content: 'product' }, From a2aaae23fe5c426452a46a4a1b0836e7338f85a1 Mon Sep 17 00:00:00 2001 From: caroolcanelas2 <160874012+caroolcanelas2@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:20:14 -0300 Subject: [PATCH 4/8] Update CHANGELOG.md --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7730cb1..e428bae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] -## [1.4.1] - 2025-07-31 - ### Fixed - The og:title was not respecting the removeStoreNameTitle tag from store settings. From 162c3d320d7781ed0a72221cea324790b90f7102 Mon Sep 17 00:00:00 2001 From: caroolcanelas2 <160874012+caroolcanelas2@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:24:11 -0300 Subject: [PATCH 5/8] Update ProductOpenGraph.tsx Correcting lint problems --- react/ProductOpenGraph.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/react/ProductOpenGraph.tsx b/react/ProductOpenGraph.tsx index cf6e543..457e06b 100644 --- a/react/ProductOpenGraph.tsx +++ b/react/ProductOpenGraph.tsx @@ -45,16 +45,21 @@ function ProductOpenGraph() { let title = titleTag || productName try { + const settings = getSettings('vtex.store') + if (!settings.removeStoreNameTitle) { const { storeName, titleTag: storeTitleTag } = settings const suffix = (storeTitleTag || storeName) && ` - ${storeTitleTag || storeName}` + if (suffix) { title += suffix } } } catch (e) { + console.error('Failed to suffix store name in title.', e) + } const metaTags = [ From 0e376dd32d9622a5e6a2ab277aed5af6200f1aff Mon Sep 17 00:00:00 2001 From: caroolcanelas2 <160874012+caroolcanelas2@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:33:30 -0300 Subject: [PATCH 6/8] Update ProductOpenGraph.tsx Fix lint errors again --- react/ProductOpenGraph.tsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/react/ProductOpenGraph.tsx b/react/ProductOpenGraph.tsx index 457e06b..0c46c21 100644 --- a/react/ProductOpenGraph.tsx +++ b/react/ProductOpenGraph.tsx @@ -44,23 +44,21 @@ function ProductOpenGraph() { let title = titleTag || productName -try { - - const settings = getSettings('vtex.store') + try { + const settings = getSettings('vtex.store') if (!settings.removeStoreNameTitle) { const { storeName, titleTag: storeTitleTag } = settings - const suffix = (storeTitleTag || storeName) && ` - ${storeTitleTag || storeName}` - + const suffix = + (storeTitleTag || storeName) && ` - ${storeTitleTag || storeName}` + if (suffix) { title += suffix } } -} catch (e) { - - console.error('Failed to suffix store name in title.', e) - -} + } catch (e) { + console.error('Failed to suffix store name in title.', e) + } const metaTags = [ { property: 'og:type', content: 'product' }, From 4b7c5439e721fbb5944a064611f0f9b6f6a996d3 Mon Sep 17 00:00:00 2001 From: caroolcanelas2 <160874012+caroolcanelas2@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:37:49 -0300 Subject: [PATCH 7/8] Update ProductOpenGraph.tsx --- react/ProductOpenGraph.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/react/ProductOpenGraph.tsx b/react/ProductOpenGraph.tsx index 0c46c21..7212afb 100644 --- a/react/ProductOpenGraph.tsx +++ b/react/ProductOpenGraph.tsx @@ -46,18 +46,18 @@ function ProductOpenGraph() { try { const settings = getSettings('vtex.store') - + if (!settings.removeStoreNameTitle) { const { storeName, titleTag: storeTitleTag } = settings - const suffix = - (storeTitleTag || storeName) && ` - ${storeTitleTag || storeName}` + const suffix = + (storeTitleTag || storeName) && ` - ${storeTitleTag || storeName}` if (suffix) { title += suffix } } } catch (e) { - console.error('Failed to suffix store name in title.', e) + console.error('Failed to suffix store name in title.', e) } const metaTags = [ From 0d0d98fff4f69f17923146110eda9d43219c4b6d Mon Sep 17 00:00:00 2001 From: caroolcanelas2 <160874012+caroolcanelas2@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:40:15 -0300 Subject: [PATCH 8/8] Fix lint errors --- react/ProductOpenGraph.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/ProductOpenGraph.tsx b/react/ProductOpenGraph.tsx index 7212afb..b407f76 100644 --- a/react/ProductOpenGraph.tsx +++ b/react/ProductOpenGraph.tsx @@ -50,7 +50,7 @@ function ProductOpenGraph() { if (!settings.removeStoreNameTitle) { const { storeName, titleTag: storeTitleTag } = settings const suffix = - (storeTitleTag || storeName) && ` - ${storeTitleTag || storeName}` + (storeTitleTag || storeName) && ` - ${storeTitleTag || storeName}` if (suffix) { title += suffix